I am using :
function AuthenticateUser(alias, password) {
//$(document).unbind('keypress');
$("#Login").unbind("click");
$.getJSON(RPC_URL + "?c=User&password=" + urlencode(password) + "&alias=" + alias + "&m=login&jsoncallback=?", function(data){
CheckAuthentication(data,alias,password);
});
}
Right now…
But instead of that, I want to use POST, instead of GET. I tried $.postJSON and $.post instead of $.getJSON here, but when i use postJSON or post, for some reason my data is not even sent. I saw that in my Temper data. Nothing happened in Temper Data.
Someone told me that this might be a cross domain issue. Because I am sending send data from my virtual.cloudbeta.com to virtual.app.cloud.com.
What should I do here.
I want to have a simple fix on this. I can not keep the data on one server or have a proxy server. One of my friend suggested me to see this : http://alvinabad.wordpress.com/2009/02/13/feb13/
But i could not get how I can use it my issue.
Plz, it would really nice to get some help on this.
Regards
Zeeshan
The proper syntax is to use .post and change the return type (4th param) to “json” as per the docs for .post:
Not quote sure the post data is how you want it formatted, but I hope you get the idea.
As for cross-domain I don’t know if there is a way around it when you’re going across domains. Subdomains are ok, but domains might be blocked.
Although really keep in mind putting it in the post isn’t going to help your security. Anyone with firebug can see the post data. If you’re worried about security encrypt the password (hash) before sending it. If a GET works for you use that, don’t just switch to POST, it isn’t buying you anything (unless of course you’re using SSL for the POST, then it’d be more secure).