473,654 Members | 3,103 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem Loading Page in Specific Div

1 New Member
Main.html
=========
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head><title>Main Page</title></head>
  3. <script type="text/javascript" src=GetPage.js>
  4. </script>
  5. <body>
  6. <form method=get onsubmit="load('History.html','GetDiv'); return false;">
  7. <input type="text" name="quota" value="">
  8. </form>
  9.  
  10. <div id="GetDiv">
  11.  
  12. </div>
  13. </body>
  14. </html>


GetPage.js
===========
Expand|Select|Wrap|Line Numbers
  1. function ahah(url,target) {
  2.     document.getElementById(target).innerHTML = 'loading data...';
  3.     if (window.XMLHttpRequest) {
  4.         req = new XMLHttpRequest();
  5.         req.onreadystatechange = function() {ahahDone(target);};
  6.         req.open("GET", url, true);
  7.         req.send(null);
  8.     } else if (window.ActiveXObject) {
  9.         req = new ActiveXObject("Microsoft.XMLHTTP");
  10.         if (req) {
  11.             req.onreadystatechange = function() {ahahDone(target);};
  12.             req.open("GET", url, true);
  13.             req.send();
  14.         }
  15.     }
  16.  
  17.  
  18. function ahahDone(target) {
  19.    // only if req is "loaded"
  20.    if (req.readyState == 4) {
  21.        // only if "OK"
  22.        if (req.status == 200 || req.status == 304) {
  23.            results = req.responseText;
  24.            document.getElementById(target).innerHTML = results;
  25.        } else {
  26.            document.getElementById(target).innerHTML="ahah error:\n" +
  27.                req.statusText;
  28.        }
  29.    }
  30. }
  31.  
  32.  
  33. function load(name,div) {
  34.  
  35. ahah(name,div);
  36. return false;
  37.  
  38. }

History.html
=============
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head><title>History Page</title></head>
  3. <body>
  4. <div id="History">
  5. <p> History Page </p>
  6. <SCRIPT language="javascript">
  7. document.write("History Page");
  8. </SCRIPT>
  9. </div>
  10. </body>
  11. </html>

The Script works great. i am able to get the History.HTML Loaded perfectly under Div=GetDiv but i am unable to execute or run the Script under history.html page when its loaded under div.

Script on history.html page works well if opened in a new browser i.e. http://localhost/history.html

My main idea is to execute the script under history page and display it under GetDiv

Please Help !!!
Aug 28 '10 #1
0 998

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3663
by: Mark Cunningham | last post by:
I am curious if there is something that would be considered a proper method for locating small (three to four items) amounts of page specific styling. Or does it really matter in the great scheme of things? I have a linked style sheet that covers everything I want to do globally. What should be done if I want to change and/or add a couple of divs and paragraphs on a specific page and the style applied is specific to that one page? ...
5
12289
by: 1337.geek | last post by:
I have a webpage, lots of javascript that i pulled from various places, the menu script pre-loads about 50 small images, it only takes about 5 seconds for broadband but for lower band connections i really dont want someone stuck in nether internet because the site's pre-loading a bunch of images. Ive seen lots of flash sites have a pre-loading page, with a status message. My question is..
1
1384
by: Tom Vukovich | last post by:
I'm having a problem loading an xmldocument from the web. The xml i wish to bring into the application is generated from a request to an ASP page. The following code does not work. xmldoc2.Load(http://Blah/Blah/blah/NYISOZoneData.asp?Zone=ALL) However if i save a copy of the generated file and load it like this, xmldoc2.Load(Server.MapPath("NYISO.XML"))
2
79959
by: Saint's Knight | last post by:
make progress bar while browser is loading page. ang when finish loading , show the page
4
52530
dmjpro
by: dmjpro | last post by:
i want to stop loading page after loading starts ... using js how can i do it thanx in advance
1
1385
by: Christopera | last post by:
So i put a php based email submit form on my website http://www.chrislivengood.net. I bought the license for some code from a company and have good success with it thus far. However, on this site I can not get the php to load the browser_out page. Any idea's why this isn't working?
1
1392
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello misters and miss, I have an application web in asp.net 2.0. I have an Main.aspx page that include javascript code like this: window.location.href = 'anotherpage.aspx'; I want do this: while IExplorer do request to anotherpage.aspx page and anotherpage.aspx is loading, I want to show a message "Loading page" in the Main.aspx page.
1
1427
Ajm113
by: Ajm113 | last post by:
How can I create that popup bar that displays "Loading Page" on it. That displays on top of the website. Then close out when page is finished loading? Just like the one on Simple Machines Forum's?
3
1215
by: vingomail | last post by:
Loading pages should be showed before the next page data are loaded. help me friends. How may i know calculate the next page controls are loaded? Is there any methods to find out this problem? Note: I don't want using ajax controls
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.