Home > front end >  I want to bring in outside in an HTML document HTML, then in this document the script will also be a
I want to bring in outside in an HTML document HTML, then in this document the script will also be a

Time:10-09

Used Ooject, but cannot obtain external HTML element, ajax didn't learn now, not too understand, o great god

CodePudding user response:

Just want to put the head. The HTML and foot. HTML import other HTML, as long as the body inside the code, and the inside of the elements in this new HTML can get

CodePudding user response:

Jqeury seem to have a load method can take the structure of an HTML file is loaded into the dom node

CodePudding user response:

refer to the second floor wind 灬 cloud response:
jqeury seems to have a load method can make the structure of an HTML file is loaded into the dom node inside

Seem to run on the server,,, this method

CodePudding user response:

reference qq_45868390 reply: 3/f
Quote: refer to the second floor wind 灬 cloud response:
jqeury seem to have a load method can make the structure of an HTML file is loaded into the dom node inside

Seem to run on the server,,, this method

No, should belong to HTML structure modularization, document; The url to your HTML file can

For example,
 

Header. The HTML structure does not need the root node and the head body these direct write a div wrapped
 

CodePudding user response:

reference wind 灬, 4/f, cloud response:
Quote: refer to the third floor qq_45868390 response:

Quote: refer to the second floor wind 灬 cloud response:
jqeury seems to have a load method can make the structure of an HTML file is loaded into the dom node inside

Seem to run on the server,,, this method

No, should belong to HTML structure modularization, document; The url to your HTML file can

For example,
 

Header. The HTML structure does not need the root node and the head body these direct write a div wrapped
 


Yes, I went back to try, with the load yesterday, estimated do wrong, by the way, which is referenced by the jquery file

CodePudding user response:


or prompt incorrect.Access to the XMLHttpRequest at "jquery file path, and introducing the file path", from origin null has had been blocked by CORS policy: Cross origin requests are only supports for protocol schemes: HTTP, data, chrome, chorme - extension, weapp, HTTPS

CodePudding user response:

refer to the second floor wind 灬 cloud response:
jqeury seems to have a load method can make the structure of an HTML file is loaded into the dom node inside


or prompt incorrect.Access to the XMLHttpRequest at "jquery file path, and introducing the file path", from origin null has had been blocked by CORS policy: Cross origin requests are only supports for protocol schemes: HTTP, data, chrome, chorme - extension, weapp, HTTPS

CodePudding user response:

You can't be directly double-click to open the preview? The file access?

CodePudding user response:

Recommend webstorm or hbuilder built-in editor preview localhost local service agreement

CodePudding user response:

Can't use the iframe? With the domain name with the window. The parent can get ()

CodePudding user response:

refer to 6th floor qq_45868390 response:
or suggest there is an error,
Access to the XMLHttpRequest at "jquery file path, and introducing the file path", from origin null has had been blocked by CORS policy: Cross origin requests are only supports for protocol schemes: HTTP, data, chrome, chorme - extension, weapp, HTTPS

Chrome local AJAX request solution
https://blog.csdn.net/qq_39206806/article/details/80940579

CodePudding user response:

11 references, the sky wave response:
Quote: refer to the sixth floor qq_45868390 response:


or prompt incorrect.Access to the XMLHttpRequest at "jquery file path, and introducing the file path", from origin null has had been blocked by CORS policy: Cross origin requests are only supports for protocol schemes: HTTP, data, chrome, chorme - extension, weapp, HTTPS

Chrome local AJAX request solution
https://blog.csdn.net/qq_39206806/article/details/80940579

If finally these on running on the server, there will be affected

CodePudding user response:

refer to 12 floor qq_45868390 reply:
Quote: 11 references, the sky wave response:
Quote: refer to the sixth floor qq_45868390 response:


or prompt incorrect.Access to the XMLHttpRequest at "jquery file path, and introducing the file path", from origin null has had been blocked by CORS policy: Cross origin requests are only supports for protocol schemes: HTTP, data, chrome, chorme - extension, weapp, HTTPS

Chrome local AJAX request solution
https://blog.csdn.net/qq_39206806/article/details/80940579

If these on the server to run, finally will have any effect
there won't be affected
  • Related