fajarhac
fajarhac

Reputation: 500

webview doesnt work ajax jquery on jelly bean

My android web app doesnt work on click jquery ajax. I don't know what code should i post because .. okay let me tell what i did try. This is link to my web (forum in malays) http://debatremaja.com/mb/cadang_tajuk . and this is app in google play store https://play.google.com/store/apps/details?id=com.debatremaja&hl=en .

Problem + Thumbs up sign in web link above will run

    $(".vote_active").click(function(){
    var topic_id = $(this).data("topic-id");
    var linkto= linktodbcontroller+"insert_vote_by_id_n/"+topic_id;
    //window.location.href = linkto;
    $(this).next(".sum").load(linkto);
    // simple prevent 2nd clicked
    $(this).removeClass("clickable");
    $(this).css("color","#0c0");
    $(this).off("click");
    });

Thanks in advance because i had experiance get my question answered less an hour after posting. Great comunity in stackoverflow.

Edit I use google hosted jquery link. is this the problem? I also use try jquery hosted in same domain (debatremaja.com) but same as before. Doesnt work.

Upvotes: 1

Views: 1757

Answers (1)

Anto
Anto

Reputation: 59

I had the same problem, add this line:

webview.getSettings().setPluginsEnabled(true);

class JsObject {
    public String toString() { return "injectedObject"; }
}
webview.addJavascriptInterface(new JsObject(), "injectedObject");
webview.loadUrl(url_webview);

It's in the google's doc

Upvotes: 2

Related Questions