0

jquery モバイルを使用してフィドラーで折りたたみ可能なセクションを作成しました。これは完全に正常に機能し、すべてのセクションが折りたたまれ ます https://jsfiddle.net/ashishrawat/cduhkLm0/

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 セクション $(document).bind('mobileinit',function(){ $.mobile.pushStateEnabled = false; });

私が見ることができる唯一の違いは、私がローカルで1.4.5を使用している間にフィドラーがjquery 1.4.4を使用していることですが、それは問題ではないと思います。提案してください !

4

1 に答える 1

0

理由は簡単でした。ページは dom のロード後に変更されるため、使用してフォームを更新する必要があります。

$("#formid").trigger("作成");

于 2015-10-26T06:25:05.627 に答える