Welcome to WebmasterWorld Guest from 54.197.156.64

Forum Moderators: open

Message Too Old, No Replies

Whats wrong with this w3 schools example.

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

Full Member

10+ Year Member

joined:July 16, 2006
posts:223
votes: 0


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...]

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

Administrator

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

joined:Aug 10, 2004
posts:10684
votes: 33


just to be clear - did you change "note.xml" to "http://www.w3schools.com/e4x/note.xml"?
9:26 am on Dec 5, 2006 (gmt 0)

Full Member

10+ Year Member

joined:July 16, 2006
posts:223
votes: 0


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.
10:26 am on Dec 5, 2006 (gmt 0)

Administrator

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

joined:Aug 10, 2004
posts:10684
votes: 33


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...

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
posts:1585
votes: 0


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.
2:46 am on Dec 6, 2006 (gmt 0)

Full Member

10+ Year Member

joined:July 16, 2006
posts:223
votes: 0


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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members