this is my code . it sends a ajax request to a page and alerts the result
function num(){
$.ajax({
type: 'POST',
url: 'num.php',
success: function(data) {
data = parseInt($.trim(data));
if(data == 1 )
alert(' its num 1');
else
alert(data)
}
})
}
num.php
<?php echo 1; ?>
it works fine in ie and ff but in chrome this conditional statement doesn't work for some reason and i get '1' in the alert window
in my personal experience your num.php file or one of the included files has a bad encoding and it's adding some invisible characters to the result . try changing encoding to utf8 without bom and remove included files from num.php