Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Adding external html content into a div using Jquery

I'm pretty new in html css and jquery. I'm building a website which will have a header, belly and footer. I'm looking to display an external html content within the website belly section.(div id=bellydiv> </div)
On the header section I have an html page embedded which contain several hyperlinks (mainmenu.html). This menu section overtime will change so I dont want the menu right on the main index.html page. I'm not using iframes because the content its not flexible with the page size and css. I'm stuck because I cant make the hyperlinks display the content on the div=bellydiv.

index.html [menu-html] menu.html [js]jqueryscript.js [belly]bellypage1.html bellypage2.html bellypage3.html etc [images]photo1.png photo2.png

Does anyone knows this ?? Thank you in advance.. :)

3 Answers

Create a "working" demo using codepen, that should let us see the bigger picture here.

Thank you James.

I'm allset. I was able to find it on

http://stackoverflow.com/questions/2494543/opening-href-in-jquery-dialog

Thanks again

I love it when people find answers to their own questions. :+1: