1

私は現在、phonegap/cordovaアプリケーションを開発しています。iOSとAndroidのビルドが機能/実行されており、どちらもJQGrid/JQPlotを利用しています。jqueryコードをwin8バージョンに更新し、厄介な例外を取り除きました。ただし、JQGrid / JQPlotの実装で、動的コンテンツの例外を追加できないという同じ問題が発生しています。そうは言っても、誰かがこれらのプラグインのいずれかまたは両方で回避策を見つけることができましたか?

編集 -

申し訳ありませんが..私はそれについてたくさん読んでいて、それを含めるのを忘れていました。

これは例外です。

 Unable to add dynamic content '<table><thead><tr class='ui-jqgrid-labels' role='rowheader'><th id='momMeasurementTable_Record' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Record' class='ui-th-div-ie'>Record<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Label' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Label' class='ui-th-div-ie'>Label<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Date' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Date' class='ui-th-div-ie'>Date<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Time' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Time' class='ui-th-div-ie'>Time<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MaxCurrent' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MaxCurrent' class='ui-th-div-ie'>Max Current (A)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MinCurrent' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MinCurrent' class='ui-th-div-ie'>Min Current (A)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MinCurrentLim' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MinCurrentLim' class='ui-th-div-ie'>Min Current Limit (A)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Resistance' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Resistance' class='ui-th-div-ie'>Resistance (mOhm)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_PFUpperLimit' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_PFUpperLimit' class='ui-th-div-ie'>Pass/Fail Upper Limit (mOhm)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MeasurementTime' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MeasurementTime' class='ui-th-div-ie'>Measurement Time (ms)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th></tr></thead></table>'. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement.  For more information, see http://go.microsoft.com/fwlink/?LinkID=247104.

ファイル:about:blank

基本的に、テーブルが生成されているとき、これは純粋にローカルアプリであり、スクリプトは安全ですが、プラグインは「安全でないコード」を実行しようとしています。

その例外は、jqueryヘッダーに表示されます。

   append: function () {
        return this.domManip(arguments, true, function (elem) {
            if (this.nodeType === 1 || this.nodeType === 11) {
                this.appendChild(elem); //<-----------------------------
            }
        });
    },

を使用してみMSApp.execUnsafeLocalFunction(this.appendChild(elem));ましたが、例外が発生しました。

Unhandled exception at line 5842, column 21 in ms-appx://664ace5f-4774-4928-bc94-ad4650a1ede1/js/jquery-1.8.2.js

0x80070057-JavaScriptランタイムエラー:引数が無効です。

これらのライブラリファイルをどこから編集/変更して、HTML /スクリプトの「安全でない」インジェクションを許可し、iOS/Androidでのようにアプリを機能させることができるかわかりません。

任意のアイデア/ヘルプをいただければ幸いです。

4

1 に答える 1

0

JQGridは大丈夫です。それを機能させるための鍵は次のとおりです。

JQUERYコードで変更する必要があります...私は助けを得ました..jQueryを使用してWindows8Metroアプリを構築 するJQGrid/JQPlotの質問を探している人にもここで指示する必要があるため、ここに答えを残します。

append: function () {
            return this.domManip(arguments, true, function (elem) {
                if (this.nodeType === 1 || this.nodeType === 11) {
                    this.appendChild(elem);
                }
            });
        },        

before: function () {
            if (!isDisconnected(this[0])) {
                return this.domManip(arguments, false, function (elem) {
                    this.parentNode.insertBefore(elem, this);
                });
            }

次のように...注意してくださいこれは、コードが安全であることがわかっている場合にのみ行ってください。

 append: function () {
            return this.domManip(arguments, true, function (elem) {
                if (this.nodeType === 1 || this.nodeType === 11) {
                    var self = this;
                    MSApp.execUnsafeLocalFunction(function () { self.appendChild(elem) });
                }
            });
        },


      before: function () {
            if (!isDisconnected(this[0])) {
                return this.domManip(arguments, false, function (elem) {
                    var self = this;
                    MSApp.execUnsafeLocalFunction(function () { self.parentNode.insertBefore(elem, self)});
                });
            }

2番目のメモ。ログにHTMLエラーが表示されますが、正しく読み込まれます。HTMLエラーは次のようになります。

HTML1701: Unable to add dynamic content '<table><thead><tr class='ui-jqgrid-labels' role='rowheader'><th id='momMeasurementTable_Record' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Record' class='ui-th-div-ie'>Record<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Label' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Label' class='ui-th-div-ie'>Label<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Date' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Date' class='ui-th-div-ie'>Date<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Time' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Time' class='ui-th-div-ie'>Time<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MaxCurrent' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MaxCurrent' class='ui-th-div-ie'>Max Current (A)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MinCurrent' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MinCurrent' class='ui-th-div-ie'>Min Current (A)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MinCurrentLim' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MinCurrentLim' class='ui-th-div-ie'>Min Current Limit (A)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_Resistance' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_Resistance' class='ui-th-div-ie'>Resistance (mOhm)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_PFUpperLimit' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_PFUpperLimit' class='ui-th-div-ie'>Pass/Fail Upper Limit (mOhm)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th><th id='momMeasurementTable_MeasurementTime' role='columnheader' class='ui-state-default ui-th-column ui-th-ltr'><div id='jqgh_momMeasurementTable_MeasurementTime' class='ui-th-div-ie'>Measurement Time (ms)<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-ltr'></span><span sort='desc' class='ui-grid-ico-sort ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-ltr'></span></span></div></th></tr></thead></table>'. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement.  For more information, see http://go.microsoft.com/fwlink/?LinkID=247104.

ファイル:about:blank

于 2013-01-10T18:42:48.030 に答える