views:

48

answers:

1

Hi, I used this method to load page ...

function remoteCall(sUrl, sQueryStr, sCalledBy)
{
    var str = " { ";

        $.post(sUrl,sQueryStr, function(data){
            sResponse[sCalledBy] = data;  //alert(data);
            eval(" "+sCalledBy+"()");
        });
}

but when i changed $.post to $.get it doesn't work actually i need to change this bcoz i am loading this page from remote page....

Please Help.

Thanks.

+3  A: 

i need to change this bcoz i am loading this page from remote page....

You need to have a look at Same Origin Policy:

In computing, the same origin policy is an important security concept for a number of browser-side programming languages, such as JavaScript. The policy permits scripts running on pages originating from the same site to access each other's methods and properties with no specific restrictions, but prevents access to most methods and properties across pages on different sites.

For you to be able to get data, it has to be:

Same protocol and host

You need to implement JSONP to workaround it.

Sarfraz