mini-project frustrations
I have to say, I'm quite frustrated with trying to get cross compatibility with IE and Firefox running my mini-project. I've been conversing with a gentlemen from a blog I was using and he offered some suggestions...he actually sent it as a comment, which you can see on this post.
This is the response I sent him, which I'm now posting on here, because I'm so frustrated with this thing!!!
I've been playing with the website, putting a new version here:
http://people.emich.edu/rschwartz/696/miniprojects/iteration3/browserTests/browserTest2/weather3.html
I've changed the var weather = request.responseXML; request to var weather = request.responseXML.firstChild.nextSibling; on my two updatePage functions (one calls current weather, the other calls future).Both functions are getting to the point where I was having trouble before with the Firefox...I'm not sure if this is a good thing or a bad thing, because before I wasn't using a debugger....at least now I'm seeing WHERE the problem is, although, I'm still not sure WHAT it is. With Firefox, I was able to fix it with using the getElementsByTagNS('site','nodename')...unfortunately, IE doesn't support level 2 DOM at this point, which is why I'm having trouble in the first place. When I made the changes you suggested, I commented out the getElementsByTagNS('site', 'nodename') and typed in getElementsByTag('nodename') in it's place. But it's still stuck!
On the current weather request IE bugs here;document.getElementById("response").innerHTML =
"" + station[0].getAttribute('name') + "
" +
station[0].getAttribute('city') + ", " + station[0].getAttribute('state') + " "+ station[0].getAttribute('zipcode') + "
" +
"Temperature: " + temp[0].childNodes[0].nodeValue +" " + temp[0].getAttribute('units') + "
" +
"Rain Today: " + rain[0].childNodes[0].nodeValue +"
" +
"Wind Speed: " + windSpeed[0].childNodes[0].nodeValue +" " + windSpeed[0].getAttribute('units') + "
" +
"Wind Direction: " + windDir[0].childNodes[0].nodeValue +"
";The debugger highlights this entire call.
On the future weather request IE bugs here:
var myResult1= "Forecast for " +
city[0].childNodes[0].nodeValue + ", " + state[0].childNodes[0].nodeValue +
" " + zip[0].childNodes[0].nodeValue + "
" + date[0].childNodes[0].nodeValue + "
";
Also, with the changes to the node calls and the response.responseXML, I'm getting the same error I was getting before with Firefox BEFORE I put in the getElementsByTagNS call.I'm utterly lost. I have no clue what to do. My teacher suggested using some sort of try/catch, which I did. I created four updatepages...two for firefox and two for IE...the problem is, IE jumps into the firefox one if I put that first and fails (because of the not supporting level 2 DOM thing...). If firefox jumps into it, it works fine....if I put the IE version first, IE is fine, but firefox errors because I need to use the level 2 DOM to parse out the data.
Anything that's bold, you'll have to ignore, because I see that the blog is taking the bold requests that I've put in quotes for my javascript requests.
Anyhow, I am asking for help at this point, because I'm so frustrated! I won't be in class next week. I'm trying to get it finished this week so I can present it on Wednesday!
Thanks everyone!