2

I have a number of html files and a single config.xml file..Though they are seperate pages they all belong to a single project..Now my config.xml file has thig tag

<widget xmlns = "http://www.w3.org/ns/widgets"
    xmlns:gap = "http://phonegap.com/ns/1.0"
    id        = "com.phonegap.capexrevex"
    version   = "1.0.0"> 

Then as i already mentioned above i have a number of html pages..

In that i have my homepage "main.html".In my homepage i need to read the version tag from my config.xml file

How do i do this using javascript/jquery ???

1 Answer 1

3

Use the jQuery $.get function and you should be able to accomplish what you are trying to do.

$.get("config.xml", function(data){
    alert($(data).find('widget').attr('version'));
});
Sign up to request clarification or add additional context in comments.

1 Comment

Note: the config.xml on the latest version of PhoneGap is not located inside the www folder. I know you can have one in the www folder but if you were to install a fresh copy of PhoneGap and create a new app, the directory structure does not put the config.xml in the www folder any more...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.