Javascript winControl属性在Windows 8应用程序开发中提供空对象

Javascript winControl属性在Windows 8应用程序开发中提供空对象,javascript,windows-8,windows-runtime,Javascript,Windows 8,Windows Runtime,加载另一个HTML页面时,该页面将semanticzoom作为分区之一,其中ZoomIn和ZoomOut是两个有界列表视图(WinJS.UI.ListView) 当我尝试访问以下代码时- WinJS.UI.Fragments.render("/OpenStore.html", target).done( function completed(r) { var zoomedOutList = document.getElementById("Zoo

加载另一个HTML页面时,该页面将semanticzoom作为分区之一,其中ZoomIn和ZoomOut是两个有界列表视图(WinJS.UI.ListView)

当我尝试访问以下代码时-

   WinJS.UI.Fragments.render("/OpenStore.html", target).done(
        function completed(r) {
              var zoomedOutList = document.getElementById("ZoomOut").winControl;
   }
   );
因此,即使存在id为“ZoomOut”的元素,它也将zoomedOutList作为空对象提供

我也尝试了以下链接,但它对我也不起作用-

我需要在之前添加这个

    var zoomedOutList = document.getElementById("ZoomOut").winControl;

您确定它已正确创建/激活吗<例如,code>data-win-control=“WinJS.UI.SemanticZoom”?如果控件已经存在,请添加HTML代码。谢谢你的回复,但我想我找到了答案。我将添加它。只在目标元素上调用
processAll
,以避免不必要的DOM扫描来寻找要激活的控件。
    var zoomedOutList = document.getElementById("ZoomOut").winControl;