Results 1 to 5 of 5

Thread: How to get started with JavaScript(jQuery) and XML

Hybrid View

  1. #1
    Join Date
    Jan 2011

    Question How to get started with JavaScript(jQuery) and XML

    I'm new to XML, so I was wondering can someone help me to get started with it.
    Basically, I have a simple HTML document:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>XML TESTING</title>
    <link type="text/css" href="jquery-ui-1.8.9.custom.css" rel="Stylesheet" />	
    		<script type="text/javascript" src="jquery-1.4.4.min.js"></script> 
    		<script type="text/javascript" src="jquery-ui-1.8.9.custom.min.js"></script>
    		<script type="text/javascript" src="script.js"></script>
    and I have a simple XML file:
    <?xml version="1.0" encoding="utf-8"?>
    	<info>Pioneer info</info>
    	<info>Khan info</info>
    	<info>Seme info</info>
    I just want to connect my XML with my HTML with JavaScript (or preferably jQuery) and change the inner text of paragraph to info value of the first product. In the end, my HTML document should have a single paragraph with a text "Pioneer info" so how do I that?
    Do I have to have a server to do that (I have WAMP installed on my PC so that won't be problem) or not?
    Basically I just need the JS or jQuery script that can connect to XML and replace contents of a paragraph with a content from a specific element from my XML.

  2. #2
    Join Date
    Jan 2011
    I suggest that you start here:


    Great website with loads of great tutorials

  3. #3
    Join Date
    Jan 2011
    Been there, but it seems that my code won't work unless I upload XML and HTML to a remote server, is there a way to run my code somehow locally?

  4. #4
    Join Date
    Jan 2011
    Ok so you want to display info from an XML file using javascript?

    maybe this is what you are looking for:


  5. #5
    Join Date
    Jan 2011
    That's about it, but it doesn't work locally.
    I've used this example as well:
    but with no luck since I have to upload all my files on a actual remote server, so my question is can I somehow run this locally?
    I've tried using WAMP, but it doesn't work.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center