Skip to content Skip to sidebar Skip to footer

How To Call A Page In Iframe When Clicking Hyperlink?

I have a left pane with 5 items as hyperlink. When i click on the hyperlink, i wanna display corresponding item description in the right hand side. I am developing the website usi

Solution 1:

If you want to use an IFrame, then you can do so, and just set the target of the hyperlink to be the name of the iFrame.

However, iFrames are considered bad practice. What would be better, is to use JQuery and use the load command.

For example, if your right hand pane has an id of right-pane:

<a href="showItem('item1-details.html')">item 1</a>

functionshowItem(url) {
    $('#right-pane').load(url);
} 

Solution 2:

You use the target attribute. :)

http://www.w3schools.com/HTML/html_frames.asp

Post a Comment for "How To Call A Page In Iframe When Clicking Hyperlink?"