0

In my android phonegap app,sometimes i get the application error as

Note when moving from one page to another page am getting this error

 **"A network error occurred.(file:///android_asset/www/home/home.html?userid=91)"** 

and app gets force closed .Please guide me to solve this problem.I am also attaching the screenshot.Its cuming in android 4.x versions

image of crash

update

$.ajax({
                cache: false,
                async: true,
                type: "POST",
                dataType: "json",
                url:url +"Status",
                data: '{"NO" : "' + no}',
                contentType: "application/json;charset=utf-8",
                success: function (r) 
                {
                     window.open("../index/index.html?id="+id);
                },
                error: function (e) 
                {
                    alert("No Network");
                }
            });
JavaH
  • 427
  • 2
  • 11
  • 29

1 Answers1

1

There is a bug in the Android 4.x OS when passing parameters along the URL:

https://code.google.com/p/android/issues/detail?id=17535 https://code.google.com/p/android/issues/detail?id=17327

coderslay
  • 13,960
  • 31
  • 73
  • 121
  • window.location ="page.html?"+value i tried this but its not working for me.how to use?kindly help me – JavaH Jul 03 '12 at 09:41
  • I also faced the same issue but cant help it as its an android issue... I found an alternative to this... I used localStorage instead of passing it in url... You also use localStorage – coderslay Jul 03 '12 at 09:48
  • @ coder_sLay how to do use local storage can you give example – JavaH Jul 03 '12 at 09:50
  • First tell me what all things you are passing in your query? – coderslay Jul 03 '12 at 10:11
  • just one id...localStorage.setItem("name", userid); var a=localStorage.getItem("name");window.open("../home/home.html?userid="+a); – JavaH Jul 03 '12 at 10:53
  • See bro... You cant use it like this... If you use '?' then you will get error. You have to open the home.html page and then get the userid through localStorage – coderslay Jul 03 '12 at 11:45
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/13352/discussion-between-javah-and-coder-slay) – JavaH Jul 03 '12 at 12:00