Jump to content

monkotronic

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

monkotronic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok i opened a child window as such: theCart = window.open("whatever.html","theCart",cartFeatures); now i want to assign a div (id= "theDiv") some innerhtml: theCart.document.getElementById('theDiv').innerHTML = theTable; where theTable is some html code. it doesn't work. i get a "element has no properties" error. any ideas? websites? tutorials? code? for me??? the question in a general sense is: How do i reference the properties of an element in a child window? explicit code would be helpful since i have tried many variations already. thanks.
  2. is there a way to actually see what is being stored into theXML.responseXML? if i use responseText instead, i get a dump of my file minus the markup. if i dump responseXML, i just get [object:xml document]. but when i try to access this object, that is when the error above gets thrown. what would cause a text return but no xml return?
  3. here is more detail (the error, the html file, the xml file)... opera throws this error (more detail than firefox): Event thread: load Error: name: TypeError message: Statement on line 32: Could not convert undefined or null to object Backtrace: Line 32 of inline#1 script in http://voodoo/sfv/testxml.html var Listing = areaXML.getElementsByTagName("time"); Line 1 of script testrun(); ______________________________________________________________ here is the html file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>asdf</title> <script > var theXML; var areaXML; function createXMLHttpRequest() { if (window.ActiveXObject) { theXML = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { theXML = new XMLHttpRequest(); } } function startRequest() { var dataFile='content/monthlycalendar.xml'; createXMLHttpRequest(); theXML.onreadystatechange = handleStateChange; theXML.open("GET", dataFile, true); theXML.send(null); } function handleStateChange() { if(theXML.readyState ==4) { if(theXML.status == 200) { areaXML = theXML.responseXML; } } } function testrun() { startRequest(); var Listing = areaXML.getElementsByTagName("time"); document.getElementById("bigone").innerHTML = Listing[0].childNodes[0].nodeValue; } </script> </head> <body onload="testrun();"> <DIV align="center" id="bigone">nothinhere</DIV> </body> </html> --------------------------------------------------------------------------------------------------------------- here is the xml file being called: <?xml version="1.0"?> <!DOCTYPE area [ <!ELEMENT area (subarea)> <!ATTLIST area name CDATA " "> <!ELEMENT subarea (event)> <!ATTLIST subarea name CDATA " "> <!ATTLIST subarea title CDATA " "> <!ELEMENT event (date, time, type, topic, notes, location)> <!ELEMENT date (#PCDATA)> <!ELEMENT time (#PCDATA)> <!ELEMENT type (#PCDATA)> <!ELEMENT topic (#PCDATA)> <!ELEMENT notes (#PCDATA)> <!ELEMENT location (#PCDATA)> ]> <area name="monthlycalendar"> <subarea name="events" title="On the Schedule"> <event> <date>2007,2,7</date> <time>8PM</time> <type>lecture</type> <topic>The Call of the Wild</topic> <notes></notes> <location>Old Temple</location> </event> <event> <date>2007,2,14</date> <time>8PM</time> <type>lecture</type> <topic>Mom is On The Phone</topic> <notes></notes> <location>New Temple</location> </event> </subarea> </area>
  4. i dont think so since areaXML is declared at the top of the script in the global space, not inside any function. it seems it must be along those lines, though, cause everything is checking out for filling the variable. is there a special way of declaring a global that i'm missing? ???
  5. thanks for the idea, but that is one of the functions for traversing an xml tree. i have it working on another site, which is why this scenario is driving me up the wall!
  6. i'm doing an XMLHttpRequest. it fetches just fine. when i dump the responseText into my innerhtml, it is fine. that was just for testing. i wanted to assign my responseXML to a variable called areaXML. my code: ----------------------------------------------------------------------- function handleStateChange() { if(theXML.readyState ==4) { if(theXML.status == 200) { areaXML = theXML.responseXML; } } } ------------------------------------------------------------------------- but when i: theDates =areaXML.getElementsByTagName("date"); i get: Error: areaXML has no properties Source File: http://voodoo/sfv/javascript/pajax.js Line: 63 i cant figure out why! the file exists, it reads it. if i dump the responseText instead of responseXML it is ok. if i dump the responseXML, it tells me it is an XMLDocument object so that seems ok. areaXML is declared in the global space so that should be ok. what could i be missing? ???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.