AjaxCross-domain prompts reload page to get source code ">
Ajax Code:
var mobile = Document.myform.b1.value;var Email = Document.myform.b2.value;var Username = document.myform.b3.value + docu Ment.myform.b4.value;var count = 10;var ojj;$.Ajax({type: ' Get ', url: ' http://a.com/app.php ', Data:{username:username,email:email,mobile:mobile},cache:false, DataType: ' Jsonp ', Jsonp: ' Callback ', Jsonpcallback: ' Success_jsonpcallback ', Success:function (e) {if (e== ' Reg_ok ') {$ ( "#reg_fail"). AddClass (' Ldisplaynone '); $ ("#reg_ok"). Removeclass (' Ldisplaynone '); $ ("#popup"). Show (). CSS ("height" , $ (window). Height ()); Count--;if (Count <= 0) {closepopup (); return;} document.getElementById (' Timeshow '). InnerHTML = Count;ojj=settimeout (function () {Prompt ()},1000);} else{$ ("#reg_ok"). AddClass (' Ldisplaynone '); $ ("#reg_fail"). Removeclass (' Ldisplaynone '); $ ("#popup"). Show (). CSS (" Height ", $ (window). Height ()); Count--;if (Count <= 0) {closepopup (); return;} document.getElementById (' Timeshow '). InnerHTML = Count;ojj=settimeout (function () {Prompt ()},1000);}},error: Function (e) {//console.log (e); Value}});
app.php file
Header ("Access-control-allow-origin: *");//allow cross-domain access first, if * represents all addresses can be accessed if only one address is accessible then write the address directly at the beginning of the full address HTTP.
Json_encode ($STR)
The above describes the Ajax cross-domain prompts to reload the page to get the source code, including the content of Ajax, I hope to be interested in the PHP tutorial friends helpful.