Dizzy death, has been in here to add a surface on the page to change the appearance of the, heavy hair.
Problem: When using AJAX to invoke a page, the ready in script in another page is not executed;
Analysis: The page is loaded with script only once when it is opened, so the ready in the page returned by Ajax does not execute;
Solve:
1, take back the content of the page JS content
function Getjavascript (data) {
var script, scripts;
scripts = [];
var regexp =/]*> ([\s\s]*?) <\/script>/gi;
while (script = regexp.exec (data)) {
Scripts.push (script[1]);
}
return scripts;
}
2, Processing JS
function Evaljavascript (scripts) {
Scripts = Scripts.join (' \ n ');
if (scripts)
(Window.execscript)? Window.execscript (Scripts): Window.settimeout (
scripts, 0);
return true;
This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20120708/31787.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service