1

I was trying to create

A.html : It contains links (Topic Headings)

B.html : It contains description of various topics separated in DIV's in a single html file

The size of B.html is very large...So when i link A.html with div id of B.html it loads entire B.html

Is there any way i can link both A and B so that link on A displays only linked DIV of B as a popup or in new tab...

This is code approach i was using

A.html
<html>
<body>
<div>
<a href="B.html#div1" rel="nofollow" target="_blank"/>Link to Topic in Page B</a>
</div>
</body>

B.html
<html>
<body>
<div id="div1">
Description of Topic A
</div>
<div id="div2">
Description of Topic B
</div>
<div id="div3">
Description of Topic C
</div>
<div id="div4">
Description of Topic D
</div>
</body>
Moody Jatt
  • 11
  • 2

2 Answers2

0

Open part of the B.html in a separate tab or display it from the A.html is possible with the iframe tag, but if you want to display specific div, I think you need to use a javascript: see Load content of a div on another page

Community
  • 1
  • 1
prompteus
  • 1,051
  • 11
  • 26
0

Hope below solution might help you

<span class="TopicHeadings" linkPageName="http://www.tutorialspoint.com/computer_whoiswho.htm #ab">Topic Heading 1</span><br>
<span class="TopicHeadings" linkPageName="http://www.tutorialspoint.com/computer_whoiswho.htm #Aa">Topic Heading 2</span><br>
<span class="TopicHeadings" linkPageName="http://www.tutorialspoint.com/computer_whoiswho.htm #bs">Topic Heading 3</span><br>
<div id="divContent"></div>




$(document).ready(function () {
    $(".TopicHeadings").on( "click", function() {
       var linkPageName = $(this).attr("linkPageName");
       $('#divContent').load(linkPageName, function() {
          alert( "Load was performed." );
       });
    });
 });

Fiddler link : sample code

Sanjay Bhardwaj
  • 412
  • 2
  • 10