This is a xmlDoc.load routine through either IE or Firefox. An RSS URL is loaded into a form. After Onclick of a button a second window is launched and a parsed listing of the original RSS file is supposed to display in a separate window. But I am getting a blank page instead. I've tried this hundred of different waya, including using innerHTML, and or shifting the javascript to the bottom of the page (I thought it might have something to do with the javascript executing before the page was loaded). I cannot use <body onload> because everything must occur after onclicks. So the onclicks are in the header (DHTML), and I've shifted the javascript to the bottom of the page. Please help!!!!!
You can use the following RSS http://www.washingtonpost.com/wp-dyn...tion/index.xml
HERE'S THE CODE:
[HTML]
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR " content="Micros oft Wordpad>
<meta name="The 36th Project" content="Miscro soft Wordpad">
<title>36th Project project</title>
<b><font size=6 face=bold>View Articles</font></b>
<div id=ReplaceMe>En ter XML file</div><BR>
<input id=T1 type=text style="width: 400"><P>
<input type=button value="Submit Query"
onclick="Replac eMe.innerHTML = T1.value";>
</head>
<body>
<form>
<input type=button value="CONTINUE "
ONCLICK="import XML()";>
</form>
</body>
<script LANGUAGE=JavaSc ript>
[/HTML] - //create an instance of the XML parser
-
-
function importXML()
-
{
-
if (document.implementation && document.implementation.createDocument)
-
{
-
var hWin=window.open("","RSSINPUT","height=300,width=750,scrollbars=yes,toolbar=yes,location=yes,directo ries=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes");
-
hWin.document.write("<HTML>\n<HEAD>\n<TITLE>XML Parse Result</TITLE>\n</HEAD>\n");
-
hWin.document.write("<BO" + "DY>\n");
-
hWin.document.write("<H2>I entered this URL, "http://www.washingtonpost.com/wp-dyn/rss/nation/index.xml", But This is blank?</H2>");
-
-
-
xmlDoc = document.implementation.createDocument("", "", null);
-
xmlDoc.onload = createTable;
-
}
-
else if (window.ActiveXObject)
-
{
-
-
var hWin=window.open("","RSSINPUT","height=300,width=750,scrollbars=yes,toolbar=yes,location=yes,directo ries=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes");
-
hWin.document.write("<HTML>\n<HEAD>\n<TITLE>XML Parse Result</TITLE>\n</HEAD>\n");
-
hWin.document.write("<BO" + "DY>\n");
-
hWin.document.write("<H2>I entered this URL, "http://www.washingtonpost.com/wp-dyn/rss/nation/index.xml", But This is blank?</H2>");
-
-
-
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
-
xmlDoc.async="false" //make sure doc is fully loaded
-
xmlDoc.onreadystatechange = function () {
-
if (xmlDoc.readyState == 4) createTable()};
-
}
-
else
-
{
-
if (xmlDoc.parseError.errorCode != 0) {
-
var myError = xmlDoc.parseError;
-
alert("You have error " + myError.reason);
-
-
}
-
xmlDoc.load('ReplaceMe');
-
-
}
-
-
function createTable()
-
{
-
-
var x = xmlDoc.getElementsBytagname("author");
-
var newEl = document.createElement('TABLE');
-
newEl.setAttribute('cellPadding',5);
-
var tmp = document.createElement('TBODY');
-
newEl.appendChild(tmp);
-
var row = document.createElement('TR');
-
for (j=0;j<x[0].childNodes.length;j++)
-
{
-
if (x[0].childNodes[j].nodeType != 1) continue;
-
var container = document.createElement('TH');
-
var theData = document.createTextNode(x[0].childNodes[j].nodeName);
-
container.appendChild(theData);
-
row.appendChild(container);
-
}
-
tmp.appendChild(row);
-
for (i=0;i<x.length;i++)
-
{
-
var row = document.createElement('TR');
-
for (j=0;j<x[i].childNodes.length;j++)
-
{
-
if (x[i].childNodes[j].nodeType != 1) continue;
-
var container = document.createElement('TD');
-
var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
-
container.appendChild(theData);
-
row.appendChild(container);
-
}
-
tmp.appendChild(row);
-
}
-
document.getElementById('writeroot').appendChild(newEl);
-
}
-
}
</script>
</html>
3 1790 acoder 16,027
Recognized Expert Moderator MVP
Move the HTML in the head (lines 10-15) into the body. Also move the JavaScript (which is currently outside the head and body) into the head section (with the script tags too).
Move the HTML in the head (lines 10-15) into the body. Also move the JavaScript (which is currently outside the head and body) into the head section (with the script tags too).
I tried that and it didn't work. I know why you suggested it though. But thanks
acoder 16,027
Recognized Expert Moderator MVP
See this script - it should be enough for your requirements.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Clara |
last post by:
Hi,...
I meant to write an application where there is a button in a window and
when you click on the button, it will open a new window, but I want the
first window to close, replaced by the second window.
I open a login window and start the mainloop, when the user click on
the login button, the __call__ function of VerifyProcessor is executed
and it will call the new window which is the file manager window
The thing is,.. I don't know how...
|
by: Michael |
last post by:
Hi,
I create site with a prefix FramSet layout.
The main page contains HTML <Form> function like this
<Form name=my_form method=post action=my_action.asp>
<input name=search_string type="text" value="user_input_here">
<input name=submit type=submit value=submit>
</Form>
|
by: Wynter |
last post by:
RE: from Displaying a Document using the ASPNET user account to the Client Browser discussion (3/2/2004
Buddy
Thanks for helping me on getting the document to display. But now I am left with a second issue. While I was displaying the document as an attachment I end up with an extra window open or if I remove the Target='_blank' then my main window goes blank
What I am doing is using the base code from...
|
by: Jose Michael Meo R. Barrido |
last post by:
|
by: Frances Del Rio |
last post by:
I'm trying to open a url in a new window while pg loads (but NOT in a
pop-up..) I need to do sthg like
// while pg is loading..
window.location ='page.html'
// but I need this to open in a new blank window..
// (NOT in a pop-up, a regular new window..)
can you do this?? thank you..
| |
by: Tavish Muldoon |
last post by:
Hello,
I have same Javascript that performs a little quiz after choose
selections from radio buttons. It displays the number of answer that
one got right. But it puts them in an alert box - I want it to be in
a new window.
The alert box works fine and show the correct data.
The button:
|
by: CYShao |
last post by:
How to import an Office window?
Hello.
I want create a MS.Office.Excel or IE window on my C# form and edit some
Excel files.
How can I do that?
Need I buy some licences from Microsoft?
Thanks
CYShao:-)
|
by: EricR |
last post by:
I am trying to bcp import a text file into a SQL Server 2000 database.
The text file is coming out of a java application where order
information is written to the text file. Each record is on it's own
row, so the last item in each record has a new line character at the
end of it to create the next row. This works well in creating the file
however bcp does not like to import this text file with the extra blank
line at the end. If I change...
|
by: TurtleGuy910 |
last post by:
When I run my graphics program a blank window appears. Here is my source code:
import java.awt.Graphics;
import javax.swing.SwingUtilities;
import javax.swing.JFrame;
public class graphicsprogram {
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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();...
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |