config.xml:
<?xml version="1.0"
encoding="UTF-8"?>
<configuration>
<appSettings>
<!-- QA
Server-->
<service
url="http://whatsup.ai.com/service/api/" />
<!-- Live
Server-->
<!--service
url="https://user.whatsup.com/service/api/" /-->
<version
versionnumber="1.0.0.0" />
</appSettings>
</configuration>
Code for accessing service url attribute of config file:
var serviceUrl;
function readServiceUrl() {
$.ajax({
url : "config.xml",
dataType : "html",
success : function(xmlResponse) {
serviceUrl = $(xmlResponse).find('service').attr('url');
},
error : function(error) {
console.log(error);
},
async : false
});
}
Hi,
ReplyDeleteGood post. I tried this on my application. It works without issues in iphone but not in android. Any idea why?
Priyan
I forgot to mention that I used settings.xml as the file name since we already have a config.xml.
DeleteIt should work in both platforms. I have done this countless times. Are you sure you put setting.xml file in www folder? if not make sure to input correct url to ajax request.
Delete