Note that there are some explanatory texts on larger screens.

plurals
  1. POmaking div behave like iframe
    primarykey
    data
    text
    <p>I want to load content of my page inside a div element using this function:</p> <pre><code>function loadmypage(DIV, pageURL) { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById(DIV).innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET", pageURL ,true); xmlhttp.send(); } </code></pre> <p>However when I click on a link inside the 'frame' itself, the function doesn't work. I guess the reason for that that the target element is in different page from the loaded page itself.</p> <p>So my question is: <em>Is there any way to make div element behave like an iframe in loading the whole page inside the frame itself?</em></p> <p>PS: I am not allowed to use iFrame for security reasons neither jQuery for efficiency reasons. links in the main page load the target normally, the problem appears when i click at any link inside these pages.</p> <pre><code> &lt;div id="nav" class="mmenu"&gt; &lt;ul type="none"&gt; &lt;li&gt;&lt;a href= "javascript:loadmypage('viewMessages.php')"&gt;Messages&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href= "javascript:loadmypage('userHomepage.php')"&gt;My Conferences&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href= "javascript:loadmypage('availableConferences.php')"&gt;Conferences&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href= "javascript:loadmypage('incomingRequests.php')"&gt;Requests&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href= #&gt;News&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href= #&gt;Options&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;div id="collabsoft" class="collabsoft"&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload