Welcome to WebmasterWorld Guest from 50.19.156.133

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Whats wrong with this w3 schools example.

     

Simone100

7:59 am on Dec 5, 2006 (gmt 0)

5+ Year Member



Hello, I am trying to get this w3 schools example working for what I need. Either one of their 2 examples on their page. It works fine in my browser viewing their page but when I put it in one of my own I can't get it to work. Instead of their local path to an xml document, I even use a full address just to make sure everything is working like it should. Are they just calling one one section of an xml document? If so can you tell which section it is? Or can someone try this and tell me what I am doing wrong?

Since I can view theirs that is a good sign at least, it tells me I should be able to use it once I figure out where my error is. Thank you very much. The link to their example page.

[w3schools.com...]

phranque

9:00 am on Dec 5, 2006 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



just to be clear - did you change "note.xml" to "http://www.w3schools.com/e4x/note.xml"?

Simone100

9:26 am on Dec 5, 2006 (gmt 0)

5+ Year Member



No I had my own xml, but I just tried that too. Doesn't work. I am getting a blank page. I have it in a .asp page. Is it supposed to be something.asp? Thanks for the help.

phranque

10:26 am on Dec 5, 2006 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



assuming you started you file with the following tags:
<html>
<head>
<script type="text/javascript">

then it would be a typical .html file that happens to contain some javascript.

since i "don't know how to spell" asp, i'm not sure if naming it .asp will serve or browse it any differently than naming it .html but it's worth a try...

daveVk

12:05 pm on Dec 5, 2006 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Make sure all content is coming from same domain as main page. Otherwise security will stop you. So if loading xml from mySite.com, move w3school example there to.

Simone100

2:46 am on Dec 6, 2006 (gmt 0)

5+ Year Member



Hi Dave! I really haven't forgotten about you, just taking a while for me to check out all the options.

I finally got their first example working sort of. Turns out their xml file had a bunch of junk in the top that wasn't supposed to be there. But their first example wont work in opera or mozilla. It just keeps loading, and loading and loading with nothing appearing on the page. Works fine in IE. On their second example that is supposed to be better,

var xmlDoc=new XML()
xmlDoc.load("note.xml")
document.write(xmlDoc.body)

.....they don't say how to use this so I couldn't get it working. I tried putting this between script tags, without script tags, in the head and in the body with no luck. Putting in the full address to note xml of course. If anyone ever tests these and figures it out because they want to know for themselves, please tell me what you did to get them working. Thanks a lot.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month