繁体   English   中英

按钮在多页面应用程序中不起作用

[英]Button not working in multi-page application

我创建了2个按钮。 第二个按钮应该转到NewFile.html,但它不起作用。 我的index.html主文件由div标记组成,在其中创建了2个按钮,其中一个按钮的ID为ForNext。

main.js

var pagesHistory = [];
var currentPage = {};
var path = "";

function wlCommonInit(){
$('#ForDeviceProp').click(deviceProp);
$('#ForNext').click(nextMethod);
}
function nextMethod() {

$("#ForNext").load(path + "pages/NewFile.html", function(){
$.getScript(path + "js/NewPage.js", function() {
          if (currentPage.init) {
            currentPage.init();
         }
    });
});

}

Newpage.js

currentPage = {};
currentPage.init = function(){
WL.Logger.debug("NewFile :: init");
};

有各种各样的问题,但主要的问题如下:

  1. 在nextMethod()中,您试图将NewFile.html加载到按钮的ID中。 那将行不通: $("#ForNext").load("pages/NewFile.html", function(){

需要将其加载到pagePort DIV中。 将“ ForNext”替换为“ pagePort”。

  1. bba= WL.Client.getEnvironmen(); ,则缺少“ .getEnvironment”中的“ t”。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM