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 901957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:38:34+00:00 2026-05-15T15:38:34+00:00

actually i am working on ajax in which i want to convert the iframe

  • 0

actually i am working on ajax in which i want to convert the iframe into div
means that what is the functionality of iframe i want the same in div

Thanks.

  • 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-05-15T15:38:34+00:00Added an answer on May 15, 2026 at 3:38 pm

    You can’t have the exact same functionality of an iframe in a simple div. That’s why they have two different names. Iframe is a bit of sandboxing, and can open urls on any domain.

    With Ajax on nowadays browsers you have to stick with the same-origin policy which means you can only load contents from the same domain your site operates on.

    So, aside from this restriction and the fact that iframe-like sandboxing cannot be emulated in a div here, is a simple ajax solution with javascript, which you can use to achive a site navigation for instance:

    HTML

    <ul id="nav">
      <li><a href="page1.html">page1</a></li>
      <li><a href="page2.html">page2</a></li>
      <li><a href="page3.html">page3</a></li>
    </ul>
    

    Javascript

    // select the menu element
    var nav = document.getElementById("nav");
    
    // watch for clicks on the menu
    nav.onclick = function(e) {
    
      // get the element that was clicked
      e = e || window.event;
      var el = e.target || e.srcElement;
    
      // only act if it was a link
      if (el.nodeName == "A") {
    
        // making a call is as simple as this
        ajax(el.href, function(data) {
    
            // do something with the server's response
            // e.g.: put it to the #content element
            document.getElementById("content").innerHTML = data;
        });
    
        // prevent default action
        return false;
      }
    };
    
    ///////////////////////////////////////////////////////////////////////////////
    
    function getXmlHttpObject() {
        var xmlHttp;
        try {
            xmlHttp = new XMLHttpRequest();
        } catch (e) {
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    
    function ajax(url, onSuccess, onError) {
        var xmlHttp = getXmlHttpObject();
        xmlHttp.onreadystatechange = function () {
            if (this.readyState == 4) {
                // onError
                if (this.status != 200) {
                    if (typeof onError == 'function') {
                        onError(this.responseText);
                    }
                }
                // onSuccess
                else if (typeof onSuccess == 'function') {
                    onSuccess(this.responseText);
                }
            }
        };
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
        return xmlHttp;
    }​
    

    ​

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually I'm working with BufferedImages, that provide me pixel values in int type. Do
I've got an ASP document that 5 years old. Actually I'm working with PHP
I'm working on a WPF application that contains a wrapper UI that is actually
Background: I'm working on a single page web app that loads everything through AJAX
I'm actually working on a job for school and I try to create a
Actually I am working on this for the last 3 or 4 weeks but
Actually ,i am working on a livechat application its works fine.This application is tabbed
I am working on an Apple MDM server, and actually it is working fine.
I have these two statements : printf(%u,a+1); and printf(%u,(int *)a+1); Actually I was working
Actually I have a file . I am working in linux environment. I need

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.