473,803 Members | 4,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Import RSS XML URL launches Blank Window instead of Listings. Please help!!!!

3 New Member
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]
Expand|Select|Wrap|Line Numbers
  1. //create an instance of the XML parser
  2.  
  3. function importXML()
  4. {
  5. if (document.implementation && document.implementation.createDocument)
  6. {
  7. 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");
  8. hWin.document.write("<HTML>\n<HEAD>\n<TITLE>XML&nbsp;Parse&nbsp;Result</TITLE>\n</HEAD>\n");
  9. hWin.document.write("<BO" + "DY>\n");
  10. hWin.document.write("<H2>I entered this URL, "http://www.washingtonpost.com/wp-dyn/rss/nation/index.xml", But This is blank?</H2>");
  11.  
  12.  
  13. xmlDoc = document.implementation.createDocument("", "", null);
  14. xmlDoc.onload = createTable;
  15. }
  16. else if (window.ActiveXObject)
  17. {
  18.  
  19. 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");
  20. hWin.document.write("<HTML>\n<HEAD>\n<TITLE>XML&nbsp;Parse&nbsp;Result</TITLE>\n</HEAD>\n");
  21. hWin.document.write("<BO" + "DY>\n");
  22. hWin.document.write("<H2>I entered this URL, "http://www.washingtonpost.com/wp-dyn/rss/nation/index.xml", But This is blank?</H2>");
  23.  
  24.  
  25. xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  26. xmlDoc.async="false" //make sure doc is fully loaded
  27. xmlDoc.onreadystatechange = function () {
  28. if (xmlDoc.readyState == 4) createTable()};
  29. }
  30. else
  31. {
  32. if (xmlDoc.parseError.errorCode != 0) {
  33. var myError = xmlDoc.parseError;
  34. alert("You have error " + myError.reason);
  35.  
  36. }
  37. xmlDoc.load('ReplaceMe');
  38.  
  39. }
  40.  
  41. function createTable()
  42. {
  43.  
  44. var x = xmlDoc.getElementsBytagname("author");
  45. var newEl = document.createElement('TABLE');
  46. newEl.setAttribute('cellPadding',5);
  47. var tmp = document.createElement('TBODY');
  48. newEl.appendChild(tmp);
  49. var row = document.createElement('TR');
  50. for (j=0;j<x[0].childNodes.length;j++)
  51. {
  52. if (x[0].childNodes[j].nodeType != 1) continue;
  53. var container = document.createElement('TH');
  54. var theData = document.createTextNode(x[0].childNodes[j].nodeName);
  55. container.appendChild(theData);
  56. row.appendChild(container);
  57. }
  58. tmp.appendChild(row);
  59. for (i=0;i<x.length;i++)
  60. {
  61. var row = document.createElement('TR');
  62. for (j=0;j<x[i].childNodes.length;j++)
  63. {
  64. if (x[i].childNodes[j].nodeType != 1) continue;
  65. var container = document.createElement('TD');
  66. var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
  67. container.appendChild(theData);
  68. row.appendChild(container);
  69. }
  70. tmp.appendChild(row);
  71. }
  72. document.getElementById('writeroot').appendChild(newEl);
  73. }
  74. }
</script>

</html>
Feb 28 '08 #1
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).
Feb 28 '08 #2
neilfarah
3 New Member
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
Feb 28 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
See this script - it should be enough for your requirements.
Feb 28 '08 #4

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

Similar topics

6
6944
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...
4
7193
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>
0
1585
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...
14
37167
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..
1
1709
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:
1
1553
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:-)
6
10000
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...
3
2045
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 {
0
9700
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
9564
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,...
0
10310
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...
0
9121
agi2029
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...
1
7603
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
6841
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
5498
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...
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
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...

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.