WebPage1.html -> Contains my actual content
WebPage2.html -> Contains some elements I want to show on WebPage1.html
So according to the info above, how to grab elements from another page/domain/etc. show them on my page with jQuery?
I don’t want to load entire page, just lets say only headers or a dropdown list or something else but only some parts.
I hope I express my questions exactly.
Thanks in advance.
What you’re looking to do is a jquery ajax request. This page describes that API. You would then use jquery selectors to extract only the elements you wanted then modify your DOM in such a way as to display them.
While in most cases, @spender is correct about cross domain requests, this link might help.
This shows how you can perform an ajax call to your own server and have it grab (and hopefully santize/process) the response you want.
This is often thought of as a poor practice and if you state what problem you are looking to solve we may be able to give you better advice.