首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在jquery mobile中可折叠在android webview中不起作用,但在fiddler中起作用

问在jquery mobile中可折叠在android webview中不起作用,但在fiddler中起作用
EN

Stack Overflow用户
提问于 2015-10-21 23:10:07
回答 1查看 187关注 0票数 0

我已经使用jquery mobile在fiddler中创建了一个可折叠的部分,它工作得非常好,并且所有的部分都可以折叠https://jsfiddle.net/ashishrawat/cduhkLm0/。

代码语言:javascript
复制
However when i take the same page and display it in webview, it doesn't work. I have inspected it in chrome and I get the same element(html) as jsfiddle, excluding the header, also there is no error in console. 
My page rendering code in android is pretty standard
    webView.addJavascriptInterface(
                        inspectView.new SurveyJSInterface(), "HTMLOUT");
                //webView.loadUrl(mSurveyUrl);
                //webView.loadDataWithBaseURL("file:///android_asset/", fileContent, "text/html", "UTF-8", null);
                webView.loadDataWithBaseURL("file:///android_asset/index.html", fileContent, "text/html", "UTF-8", null);
                webView.setInitialScale(1);
                webView.getSettings().setSaveFormData(true);
                webView.getSettings().setLoadWithOverviewMode(true);
                webView.getSettings().setUseWideViewPort(true);

文档部分$( HEader ).bind(‘mobileinit’,HEader(){ $.mobile.pushStateEnabled = false;});

我能看到的唯一区别是,fiddler使用的是jquery 1.4.4,而我在本地使用的是1.4.5,但我不认为这有什么关系。请给我建议!

EN

回答 1

Stack Overflow用户

发布于 2015-10-26 14:25:06

原因很简单。页面是在dom加载后修改的,因此需要使用重新整理表单。

$("#formid").trigger("create");

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33262957

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档