I have developed android phonegap application using phonegap 1.9.0.Its was working fine in android 2.2 and 4.0.Later i changed the phonegap version and currently i am using phonegap 2.1.0.Its working fine in android 2.2 but in android 4.0 i cannot able to navigate from one page to another,while passing the value as query string.
Here is my code:
function onClick()
{
var id="2";
window.open("index2.html?id="+id);
}
Index2.html:
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++)
{
var pair = vars[i].split("=");
if (pair[0] == variable)
{
return pair[1];
}
}
}
Get the value in index2.html as
var id=getQueryVariable("id");
Please help me.Thanks in Advance.
I switched to 2.0.0 specifically due to a bug with query string in prev versions and android 4. Gave the 2.1.0 a try and it is broken again. Why I wanted to upgrade? Because 2.0.0 has camera issues like user takes a pic that is supposed to show on a web page and the success function or fail are not fired. Tried with 10, 50 and 100 % picture quality. It works on my phone but not on others with same ver Android.