This project is archived and is in readonly mode.

#1211 ✓invalid
vinson

Cannot use if statement within onComplete() by using returned data of request

Reported by vinson | April 6th, 2011 @ 08:19 PM

Hello, I wonder why if statement does not work properly in my code:

PHP:

process.php

<? echo '1'; ?>

HTML:

var req = new Request({

    url: 'process.php',
    method: 'post',

    onSuccess: function(response) {
        
        if(response=="1"){
            alert('hi');
        }
    }
}).send(data);

Firebug shows that it returned '1' in both response and html, but no alert.

Thank you:)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages