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

  • SEARCH
  • Home
  • 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 6118571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:27:07+00:00 2026-05-23T15:27:07+00:00

Here is an HTML page where I want to load an element with a

  • 0

Here is an HTML page where I want to load an element with a php script using ajax.

<?php require_once('connect.php'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<?php require("pagetitle.php"); ?>

<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess -->
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> -->

<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css" type="text/css" media="all" 

/>

<!-- Portal JavaScript -->
<script type="text/javascript" src="portal.js"></script>

<script type="text/javascript">
    var http = false;
    if(navigator.appName == "Microsoft Internet Explorer") {
      http = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
      http = new XMLHttpRequest();
    }
    function LoadCalendar() {
      http.abort();
      http.open("GET", "calendar/index.php?cP=2", true);
      http.onreadystatechange=function() {
        if(http.readyState == 4) {
          document.getElementById('litcal').src = http.responseText;
        }
      }
      http.send(null);
    }
</script>

</head>

<body onload="appendTitle('Calendar');">

<div id="content-body"><a name="top"></a>
  <h1>
    <iframe id="litcal" onload="LoadCalendar();" style="padding: 0px 0px 0px 0px; border: 1px solid #404040;" width="690px" 
height="691px"></iframe>
  </h1>  
</div> <!-- End CONTENT-BODY div -->

</body>
</html>

The loaded element is empty. It only has <html></html>. What error in the ajax code caused this?

  • 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-23T15:27:08+00:00Added an answer on May 23, 2026 at 3:27 pm

    The problem was that the PHP was not returning a URL. So ajax could not assign anything to the src. See this question for the code that worked.

    https://stackoverflow.com/questions/6612918/loading-an-iframe-with-ajax/6618656#6618656

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

Sidebar

Related Questions

I'm Using AJAX to dynamically fetch data from my php page (which contains html)
Here is my main page code: <form><iframe name=iframe_pic src=iframe.html></iframe></form> Here is my iframe.html: <script
Basically I want to load a HTML document and using controls such as multiple
I want to load a html page from a file, and append a hash
when I load a static html page I want to send a JS Object
I am building an AJAX deep-linked site. I want PHP to load all the
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
here is the test page http://www.studioteknik.com/html/test-portfolio.html I got no error, but no hover-slide effect...
In my main page (call it index.aspx ) I call <%Html.RenderPartial(_PowerSearch, ViewData.Model);%> Here the
As I mentioned here , I'm trying to generate HTML from an ASPX page

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.