Rosie123 Posted January 8, 2020 Share Posted January 8, 2020 I want to setup a javascript page on my website where I have a xml file that has a name comment and gps coordinates. The user types in the name and and it searches the xml file and spits out the comment and coordinates. My main question is where can I upload file for my page to search and how( what path do I use to read it in) Link to comment
Rosie123 Posted January 10, 2020 Author Share Posted January 10, 2020 So my code is in a embedded code block, and there is no link editor, so how do upload the file? Link to comment
Rosie123 Posted January 10, 2020 Author Share Posted January 10, 2020 So this is my code if I use the path "/s/cd_catalog.xml" or "cd_catalog.xml" I get a status of 404 If I use "s/cd_catalog.xml" I get a status of 0 which doesn't make sense <button type="button" onclick="loadXMLDoc()">Get my CD collection</button> <br><br> <table id="demo"></table> <script> function loadXMLDoc() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { var table=this.status; document.getElementById("demo").innerHTML = table; }; xmlhttp.open("GET", "s/cd_catalog.xml", true); xmlhttp.send(); } </script> Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.