You can call this script in ie8, press enter in the address bar of ie8, and then call jquery's object and method. However, there is a problem after refreshing. After refreshing, press enter in the address bar.
The Code is as follows:
Function include (path ){
Var a = document. createElement ("script ");
A. type = "text/javascript ";
A. src = path;
Var head = document. getElementsByTagName ("head") [0];
Head. appendChild ();
}
Include ("http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js? 1.1.9 ")
You can call this script in ie8, press enter in the address bar of ie8, and then call jquery's object and method. However, there is a problem after refreshing. After refreshing, press enter in the address bar.
There is no problem under Firefox. The following is an html Script For window. name. You can test it:
The Code is as follows:
Demo: Cross-Origin
Script
Function include (path ){
Var a = document. createElement ("script ");
A. type = "text/javascript ";
A. src = path;
// If (a. readStatus = 200 ){
Var head = document. getElementsByTagName ("head") [0];
Head. appendChild ();
//}
}
Include ("http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js? 1.1.9 ")
Script
Script
$ (Function (){
Function sendData (url, callback ){
If (! Url | typeof url! = 'String '){
Return;
}
Url + = (url. indexOf ('? ')> 0? '&':'? ') + 'Windowname = true ';
Var frame = $ (''). appendTo (" body ");
Var state = 0;
Var clear = function (){
Try {
Framework0).contentdomaindoc ument. write (''); // clear iframe content
Frame [0]. contentWindow. close (); // prevent iframe Memory leakage
Frame. remove (); // Delete iframe
} Catch (e ){}
};
Var getData = function (){
Try {
Var data = frame [0]. contentWindow. name;
} Catch (e ){}
Clear ();
If (callback & typeof callback === 'function '){
Callback (data );
}
};
Frame. bind ('load', function (){
If (state = 1 ){
GetData ();
} Else if (state = 0 ){
State = 1;
Frame [0]. contentWindow. location = "none.html ";
}
});
Frame [0]. src = url;
}
// Application:
Var testurl = 'HTTP: // www.jb51.cn/test.html ';
$ ("Button"). click (function (){
SendData (testurl, function (result ){
Var fishDiv =$ ("# oldFish ");
FishDiv.html ("the data you obtained is:" + result );
})
})
})
Script
Remote Data Loading
Dev By material download & Hua
Reference: foot home