Jquery mobile Worklight应用程序在Windows 8上崩溃

Jquery mobile Worklight应用程序在Windows 8上崩溃,jquery-mobile,windows-8,ibm-mobilefirst,Jquery Mobile,Windows 8,Ibm Mobilefirst,我正在使用Worklight 5.0.6开发一个应用程序。该应用针对平板电脑(iOS、Android和Windows)。该应用程序在iOS和Android上运行良好,但在Windows8上正常运行时遇到了问题。当我点击链接时,应用程序崩溃。以下是错误消息的一部分: "HTML1701: Unable to add dynamic content ' <link/><table></table><a href='/a'>a</a><

我正在使用Worklight 5.0.6开发一个应用程序。该应用针对平板电脑(iOS、Android和Windows)。该应用程序在iOS和Android上运行良好,但在Windows8上正常运行时遇到了问题。当我点击链接时,应用程序崩溃。以下是错误消息的一部分:

"HTML1701: Unable to add dynamic content '  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>'. 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."

我的密码有错吗?任何帮助都将不胜感激。如果需要更多信息或源代码,请告诉我。

这是Win8 Metro上jQuery的问题。Metro应用程序具有动态内容限制,需要首先绕过这些限制。下面是一个堆栈溢出问题,该问题有很多答案:


问题已经解决,谢谢。我必须用MSApp.execUnsafeLocalFunction包装代码,这样看起来:

function loadPartialWithFunction(path, elementId, aFunction)
{
    $.get(path, function (data) {
        MSApp.execUnsafeLocalFunction(function(){
            $(elementId).html(data).trigger("create");
            $("#my-navbar > ul").removeClass("ui-grid-a");
            if (!hideDuringFocus)
            {
                $("[data-role=header]").fixedtoolbar({ hideDuringFocus: "" });
                $("[data-role=footer]").fixedtoolbar({ hideDuringFocus: "" });
            }
            aFunction();
       });
    });
}  

这是个好消息。谢谢如果可能,请标记为已回答。
function loadPartialWithFunction(path, elementId, aFunction)
{
    $.get(path, function (data) {
        MSApp.execUnsafeLocalFunction(function(){
            $(elementId).html(data).trigger("create");
            $("#my-navbar > ul").removeClass("ui-grid-a");
            if (!hideDuringFocus)
            {
                $("[data-role=header]").fixedtoolbar({ hideDuringFocus: "" });
                $("[data-role=footer]").fixedtoolbar({ hideDuringFocus: "" });
            }
            aFunction();
       });
    });
}