Ajax get throws a syntax error when ip is given instead of localhost
- by Aruna
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