0

the alert message is not showed in android emulator. I've already read this and this, and did not find any info that helped.

The code is:

$.ajax({
    url: "-url here-",
    data: { - data here - },
    type: "POST",
    dataType: "xml",
    statusCode: {
       0: function () {
            alert('Thank You');
       },
       200: function () {
            alert('Thank You');
       }
    }
});

and:

if (hourFrom1=="N/A" || minFrom1=="N/A" || hourTo1=="N/A" || minTo1=="N/A") {
    alert('Please check time input.');
    return;
}
if (customer=="" || project=="" || assignment=="") {
    alert('Please check customer/activity description input.');
    return;
}

I use jquery-1.11.1.min.js.

None of those 4 alerts doesn't work. In the first part, the data is sent OK.

They work pretty well in browsers though..

What am I missing?

Thank you.

EDIT

JS is allowed:

WebView myWebView = (WebView) findViewById(R.id.webView1);
WebSettings s = myWebView.getSettings();
s.setJavaScriptEnabled(true);
Community
  • 1
  • 1
keshet
  • 1,716
  • 5
  • 27
  • 54

2 Answers2

0

try include: http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js in a script tag.

  • I tried and included `jquery.mobile-1.4.3.min.js`. It didn't help. Or is that version not OK? – keshet Jul 23 '14 at 19:18
  • Hmm ok was just making a best guess anyways, I found something else for you to try. Someone else has had somewhat the same problem at: http://stackoverflow.com/questions/5747382/jquery-mobile-alert-confirmation-dialogs – Christian Bøge-Rasmussen Jul 23 '14 at 20:59
0

I have found the solution. It come from HERE.

I had to add to MainActivity.java file the following line (the second one):

WebView myWebView = (WebView) findViewById(R.id.webView1);
myWebView.setWebChromeClient(new WebChromeClient());

That did the trick.

I also found the answer in THIS post.

Community
  • 1
  • 1
keshet
  • 1,716
  • 5
  • 27
  • 54