I wounder if there is any way to load in content from a external page (page in same website/root) to a div wihout using javascript?
The site use alot of jquery load() but it have a page that must be available wihout having javascript activated. It should fit the website structure much better to load in that content insteed of reload the whole page, so now I looking for some solution without javascript if that exist.
Example: the div I want to load content to is Index.html #get_content and the page and div that contains the content is Content.html #send_content.
Thanks.
jQuery load() is the best way to accomplish this on the server-side.
You could use an iFrame, like this:
There’s a lot of properties which can be used in
iFrameto adjust the width, border, height and other stuff.And starting in HTML5 (Only Chrome has support for this yet), you can use the
seamlessproperty to kinda make the iFrame part of the document, likeload(), instead of a window inside a document.Usually PHP is a really easy server-side language to cut-and-paste into your projects (unless if it’s depend on another conflicting server-language) and you could do something like this, which would accomplish something just like
load():Edit: As Juan Mendes pointed out, you would be responsible for fetching the related JS and CSS if you used PHP (or any server-language at any rate), and that the CSS/JavaScript may not work because some selectors may depend on parent/ancestor nodes being present. With iFrames, you’re just viewing the external page within your document, unlike server-language parsers, which scrape the code from the site and then print it on the page.