This topic is in the Website Design discussion forum.  (rss)


XML HTTP Request Inside of Another XML Anyone?




Topic started on 11-12-2006 @ 12:39 AM by razor1000


okay here is my script on a js file
function ajaxLoader(url,id)
{
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x)
{
x.onreadystatechange = function()
{
if (x.readyState == 4 && x.status == 200)
{
el = document.getElementById(id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}


id="content">
id="sidebar">
id="menu">


//so here is the code to get the xml file to load another VID layer but it doesnt work for some reason and VID is just the id for a DIV and i left the href out it works from an html ut not from an xml loaded from an html???
onClick="ajaxLoader('xmlhelp/music.xml','vid')"MUSIC
PROJECTS



This menu is dynamic to the application you are using







id="Vid"> //this is the div that displays the content

HELP FILE


This is the tet section






so let me explain one more time what i'm trying to do here
i'm making a website which uses separate xml files to show the content
in turn the xml loads a specific menu for the different groups of pages kinda like a drop down without the drop. but the problem is that when i load the new file using xml the menu does not work so what am i doing wrong here?

*Caps lock edit*

[edit on 3-1-2007 by dbates]


reply to this post:   copyright & usage 


reply posted on 11-12-2006 @ 12:46 AM by Mechanic 32


I'm not sure about xml, but it looks like your first if statement terminates prematurely for one...

But that is only a guess.

And your second if statement does'nt look right.

Also a guess, on my part

from my limited experience with VB, I know that when your nesting multiple statements like that, there are bound to be errors. I would wager that it is either one or the other, or both of what I stated above.



[edit on 12/11/2006 by Mechanic 32]



reply to this post:   copyright & usage 


reply posted on 11-12-2006 @ 12:58 AM by razor1000


i think i erased it when i was getting rid of te empty spaces, in order to post it here and then more stuff got erased by the board

[edit on 12/11/2006 by razor1000]



reply to this post:   copyright & usage 


reply posted on 11-12-2006 @ 01:04 AM by Mechanic 32


what you could do alternatively then, is to type it out in MSPAINT, or equivalent, then post the resulting pic.

Yeah, the board probably has filters for code, to deter hackers.



reply to this post:   copyright & usage 


reply posted on 11-12-2006 @ 01:08 AM by razor1000


here is the xml
< ?xml version="1.0" encoding="UTF-8" ?>

< description>
< div id="content">
< div id="sidebar">
< div id="menu">
< p class="h4">
< a onClick="ajaxLoader('xmlhelp/music.xml','vid')"MUSIC< /a>
PROJECTS


< /div>
< p>This menu is dynamic to the application you are using< /p>
< /vid>

< /div>


< div id="Vid">
< p align="center" class="h1">HELP FILE< /p>
< p>This help file is meant to provide information to common issues in using this website.
If you are having problems aside from anything explained here please send us an E-mail about it.
Also please remember this website is still being constructed so please excuse any bugs you may run across that is all.< br>
This help file is incomplete right now, please bear with us while we upload all the data.
< /p>
< /div>
< /div>
< /description>
and here is the JS
function ajaxLoader(url,id)
{
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x)
{
x.onreadystatechange = function()
{
if (x.readyState == 4 && x.status == 200)
{
el = document.getElementById(id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}
ok so this is called in the html file like this
< html>

< head>

< link rel="stylesheet" type="text/css" href="scripts/ml.css">

< script "JavaScript1.2" src="scripts/scripts.js">< /script>
< /head>
< body id="body" onLoad="ajaxLoader('xml/index.xml','content')">
< div id="middle">
id="header">
< marquee style="color:blue; font-size:14px; font-weight: normal; font-style: normal; font-family: Arial; border: 1px solid" border="1"> Welcome to ChronostarGraphics.com, the the official site of the Chronostar Universe! This is our new website, and it is the 5th generation in that!
< /div>
< div id="content">

< /div>
< div id="footer">


onClick="ajaxLoader('xml/index.xml','content')">HOME |
onClick="ajaxLoader('xml/udf.xml','vid')">UDF ARCHIVE |
onClick="ajaxLoader('xml/dvd.xml','content')">DVD SERVICES |
onClick="ajaxLoader('xml/projects.xml','content')">PROJECTS |
onClick="ajaxLoader('xml/contact.xml','content')">CONTACT US |
onClick="ajaxLoader('xml/help.xml','content')">HELP
< /p>



< /div>
< /body>
< /html>

[edit on 12/11/2006 by razor1000]


reply to this post:   copyright & usage 


reply posted on 3-1-2007 @ 08:37 PM by dbates


The only thing I can see wrong with the XML is that the line break (BR) should have a self closing tag like "<BR />". Other than that I dont' see anything right off hand. My bet is that the error is in the _javascript portion of the code. Open your page in Mozilla Fire Fox and selelect JavaScrpt Console under the Tools menu. If a dynamic feature is not working that's where I usually start.



reply to this post:   copyright & usage 


reply posted on 27-2-2007 @ 10:22 PM by razor1000


i figured out what the problem was since i wasnt using an absolute URI the xml file did not know where to call the next xml file from but now its working so you can visit my site and try it out, by the way i made it for IE7 so it should be working fine in other browsers but for best effect use IE ok the link is in my signiature let me know how you like what i'm doing there ius still a lot more left to add however but the layout is pretty much donne



reply to this post:   copyright & usage 


reply posted on 2-10-2007 @ 02:07 AM by razor1000


hey o anyone that is interested i will be uploading the new version of my site in a few days so check out the current version if you want to se the improvements



reply to this post:   copyright & usage 










Top Topics Right Now:



Active Topics Right Now:



ATS MIX Podcasts:











Newest Topics:































ATS Server: www4.theabovenetwork.com
Powered by AboveTop:Board v2.3
Header data processed in 0.002 seconds
Page processed in 0.068 seconds
6 total database queries (1)









The Below Top Secret General Discussion Web site is a wholly owned social content community of The Above Network, LLC.





thread
Forums Directory