Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7912255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:33:15+00:00 2026-06-03T13:33:15+00:00

I want to load content of my page inside a div element using this

  • 0

I want to load content of my page inside a div element using this function:

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 && xmlhttp.status==200)
    {
    document.getElementById(DIV).innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET", pageURL ,true);
xmlhttp.send();
}

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.

So my question is: Is there any way to make div element behave like an iframe in loading the whole page inside the frame itself?

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.

 <div id="nav" class="mmenu">
                                <ul type="none">

                                            <li><a  href= "javascript:loadmypage('viewMessages.php')">Messages</a></li>
                                            <li><a  href= "javascript:loadmypage('userHomepage.php')">My Conferences</a></li>
                                            <li><a  href= "javascript:loadmypage('availableConferences.php')">Conferences</a></li>
                                            <li><a  href= "javascript:loadmypage('incomingRequests.php')">Requests</a></li>
                                            <li><a  href= #>News</a></li>
                                            <li><a  href= #>Options</a></li>


                                        </ul>
                                    </div>
                            </fieldset>

                                        <div id="collabsoft" class="collabsoft">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:33:17+00:00Added an answer on June 3, 2026 at 1:33 pm

    Your links don’t work because you’re missing your div argument. Notice your function:

    function loadmypage(DIV, pageURL)
    {
    ...
    

    The first argument is DIV, and you’re passing the pageURL only.

    <li><a  href= "javascript:loadmypage('viewMessages.php')">Messages</a></li>
                                                <li><a  href= "javascript:loadmypage('userHomepage.php')">My Conferences</a></li>
                                                <li><a  href= "javascript:loadmypage('availableConferences.php')">Conferences</a></li>
                                                <li><a  href= "javascript:loadmypage('incomingRequests.php')">Requests</a></li>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m using jquerymobile, I want to put content inside the page fetched by
I have a code <div id=content></div> I load into this content my Ajax content
I am using Jquery load() to load external pages inside a DIV, so far
I want to load content from a page hosted on another site. The problem
I want to load only links within a certain div inside the tab, otherwise
I have a page that's content is already inside a tab, and don't want
When using jQuery and fancybox for showing another page inside an iframe I want
i want to load an array of page-specific external .js files. in the past,
I want to load a static text file from an HTML document without using
I want to load a desktop application, via reflection, as a Control inside another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.