Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,

I my aspx page I have to read an XML file, which is reside in server side from client side. I have to read the contents of the XML file.
 
Thanks,
Velkumar.
Posted 18-Jun-12 21:20pm
Comments
Sergey Alexandrovich Kryukov at 19-Jun-12 2:29am
   
"Read" or perhaps "parse"?
--SA
Sergey Alexandrovich Kryukov at 19-Jun-12 2:30am
   
Did you notice this is not a question? Besides, why not just finding and answer in the Web? It would be way faster...
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I don't think you mean "read", as you probably know how to read any text file. You probably need parsing.
 
Please see this question: http://stackoverflow.com/questions/649614/xml-parsing-of-a-variable-string-in-javascript[^].
 
First of all, you need to look for the answers with DOMParser.
 
—SA
  Permalink  
v2
Comments
Velkumar Kannan at 19-Jun-12 2:34am
   
I want to just load an XML file from server using javascript. ie. Using client side code I want to load and get the contents of a XML file.
Sergey Alexandrovich Kryukov at 19-Jun-12 3:11am
   
For goodness sake, what is "just load"?.. :-)
--SA
Manas Bhardwaj at 19-Jun-12 6:30am
   
correct +5!
Sergey Alexandrovich Kryukov at 19-Jun-12 10:01am
   
Thank you, Manas.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You want to know how to talk to server from Javascript.
 
There are few ways to interact with server side through client side(Javascript):
1. XMLHttpRequest[^]
2. Callback[^]
3. WebService call[^]
4. PageMethod[^]
 
If you are not using ASP.NET then XMLHttpRequest or Callback is the way.
To use XMLHttpRequest or Callback, you can use jQuery. Here, have a look:
http://api.jquery.com/jQuery.ajax/[^]
http://api.jquery.com/category/ajax/[^]
http://www.w3schools.com/jquery/jquery_ref_ajax.asp[^]
  Permalink  
Comments
Velkumar Kannan at 19-Jun-12 2:35am
   
I want to just load an XML file from server using javascript. ie. Using client side code I want to load and get the contents of a XML file.
Sandeep Mewara at 19-Jun-12 2:51am
   
And using XMLHttpRequest can get you exactly what you want.
Manas Bhardwaj at 19-Jun-12 6:30am
   
Good links +5!
Sandeep Mewara at 19-Jun-12 11:08am
   
Thanks.
Sergey Alexandrovich Kryukov at 19-Jun-12 10:04am
   
The question is not clear, so it may or may not be about parsing. What is "load", "get contents"?
Anyway, the links provide good overview, my 5.
--SA
Sandeep Mewara at 19-Jun-12 11:08am
   
Thanks SA.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Comments
Manas Bhardwaj at 19-Jun-12 6:30am
   
my 5!
Prasad_Kulkarni at 19-Jun-12 8:34am
   
Thank you Manas!
Sergey Alexandrovich Kryukov at 19-Jun-12 10:02am
   
Useful links, a 5.
--SA
Prasad_Kulkarni at 19-Jun-12 23:58pm
   
:) Thank you SA!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 504
1 Maciej Los 349
2 Kornfeld Eliyahu Peter 325
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 19 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100