cordova :: XMLHttpRequest :: setRequestHeader does not work with JSONP
I have a script for web site scraping testing. In Chrome, I used Ripple extension. If the emulator is disabled,
I can retrieve the token from the html page. But if I enable the emulator, I got the following error. I wrapped it
in phongap and deployed in an Android device, the corresponding tag content is not updated at all.
I appreciate your help to get this resolved.
- cordova :: XMLHttpRequest :: setRequestHeader does not work with JSONP. ripple.js:36
-
-
-
-
-
-
-
included scripts in html:
<link rel="stylesheet" href="jquery.mobile-1.2.0.css" />
<script src="jquery-1.8.3.js"></script>
<script src="jquery.mobile-1.2.0.js"></script>
<script src="parse.js"></script>
parse.js
function getDownloadToken()
{
$.ajax({
url: 'https://www.myhealth.va.gov/mhv-portal-web/anonymous.portal?_nfpb=true&_nfto=false&_pageLabel=mhvHome',
type: 'GET',
dataType: 'html',
success: function(data,status, jqXHR){
var downloadToken = $("input[name='loginPortlet_homepageorg.apache.struts.taglib.html.TOKEN']", $(data)).attr ("value");
console.log(jqXHR.getAllResponseHeaders());
vaCookie = jqXHR.getResponseHeader('Set-Cookie');
$('p#token').text("token"+downloadToken);
$('p#cookie').text("cookie"+vaCookie);
},
error: function(data) {
console.log(data);
}
});
}