Could JavaScript load data from another page / file? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Could JavaScript load data from another page / file?

How to JavaScript load data from another page?

6th Feb 2017, 7:26 PM
Sandip Sarkar
Sandip Sarkar - avatar
1 Answer
+ 2
Yes, it can load an external file, but preferably with a server. Loading data from another page might violate some security issues, I think... To load files from a server, make use of the XMLHttpRequest function. Compatibility is another issue with IE and older browsers. Read on XMLHttpRequest, Microsoft's ActiveXObject and XDomainRequest. Generally, read on AJAX.
7th Feb 2017, 12:16 PM
John
John - avatar