I am trying to find a way for xml cross-domain. After googling I found that might be done by jsonp, but I did not get very well the way how it works also after seeing jsonp with jquery and Basic how-to for cross domain jsonp.
I have a pice of html code like following:
<form id="f" name="f" method="POST" action="index.php">
<input type="text" id="t" name="t">
</form>
and in javascript part:
if( typeof (xmlhttp)=="object")
{
xmlhttp["open"]("GET",pURL,true);
}
}
where pURL = index.php?p1="x"&p2="y"
I tried something but it does not work,so I am wondering how I can change the following code to make it correct?
<script>
$.getJSON("http://domainXYZ.com.indexPHP?jsoncallback=?",
{
t: "inputValue"
},
function(data) {
$.each(data, function(data){
alert(data);
});
});</script>
Any Idea will be appreciated.