I am currently working on a way to load content from another page into my page. What I want to have is, that the content itself is loaded from one div of the the other page into a specific div of my page.
So far it is working to load the other page's content into my div. Also I figured out how to show a specific div of the other page in my page's div.
jsfiddle: http://jsfiddle.net/gfnyyrx2/1/
jQuery:
<script>
jQuery(document).ready(function() {
jQuery("#region").html('<object data="http://de.selfhtml.org/#wiki">');
});
</script>
HTML:
<div id="content" class="box"></div>
My problem now is that the whole content from the other page is loaded into my div.
the #divname only jumps to the wanted div. But the rest of the other page is loaded as well. If you use the scroll bars you can see the whole content is there.
Is there anyway to ONLY load the content of the div and not the whole content of the other page? And my Second Question is, how can I give the div on my page a size? As you can see in the fiddle I already tried to give my div a height and width. But it only changes the size of the div but not the size of the content Box.
$.loadalso you lets you specify a selector, to extract only part of the loaded content. You need to show the rest of your code. Re size, again you need to show the loaded content as it may be as simple as appropriate CSS styling.<div id="wiki">. thats why i used the URLhttp://de.selfhtml.org/#wikibut i only want that grey box on my page. not the whole page as it is right nowload. Second part, can you please explain what it should look like as your CSS seems to be doing what you asked it to.