Ajax get throws a syntax error when ip is given instead of localhost
        Posted  
        
            by Aruna
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Aruna
        
        
        
        Published on 2010-06-01T06:20:36Z
        Indexed on 
            2010/06/01
            6:23 UTC
        
        
        Read the original article
        Hit count: 276
        
Hi ,
i am working on cakephp. I have developed an application where i have used localhost in all ajax post and get..
like
                  var ht = $.ajax({
                          type: "GET",
                          url: "http://localhost/FormBuilder/index.php/forms/getInvitees/<?php echo $emailid;?>",
                          async: false
                    }).responseText;
                     var myObject = eval('(' + ht + ')');
this thing works only when i put localhost . But when i change that to my Ip like
http://111.11.11.11/FormBuilder/index.php/forms/getInvitees/",
 then  i am getting a syntax error () in the line
                var myObject = eval('(' + ht + ')');
WHy it happens ?? Please give valuable suggestions in solving this..
Thank you
© Stack Overflow or respective owner