In javascript, element = document.getElementById(id); if I want to access some values from XML(or similar) document, can I change the document value in above code to that particular document and not the current document?
-
-
Answer:
So you want javascript to change something in a different document than the one it's loaded in? You can't. JavaScript is client-side - and unless you serve that client a document with javascript, it can't do that. document is the currently loaded document in the browser and is the highest scope (apart from window). You might want to learn more about what JavaScript actually does.
Giordon Stark at Quora Visit the source
Other answers
Load the JSON/XML document using ajax in JS and you can then parse it and put the element equal to the required parsed value.
Bhanu Pratap
Related Q & A:
- How can I change a value in an array?Best solution by Stack Overflow
- I want to change my cellphone number on Yahoo mobile. How can I do this.Best solution by Yahoo! Answers
- I want to display my picture on my messenger window, how can I do it.Best solution by mydisplayimage.com
- How can I change my ID name?Best solution by Yahoo! Answers
- How can i change my ID?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.