Question: I am using jquery:

```
    $.get(URL, function(data){

            if(data == 'no_credits'){
                alert("no credits");
                return;
            }
            else{
                // WHY HERE>?!
            }

```

and my problem is that url return 'no\_credits' but code goes to `else` block code, please help!

EDIT : `alert(data);` prints no\_credits

Answer: 
You probably have trailing spaces or capitalization differences.

Try

```
if($.trim(data).toLowerCase() === 'no_credits'){

```
Have you tried dumping the data object ? do a `console.log(data);` in Firefox (with installed firebug) and check the firebug console. I think the data is not the output of the server but a response object.