按钮在多页应用程序中不起作用 [英] Button not working in multi-page application
本文介绍了按钮在多页应用程序中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了2个按钮.第二个按钮应该转到NewFile.html,但是它不起作用.我的index.html主文件由div标记组成,在其中创建了2个按钮,其中一个按钮的ID为ForNext.
I have created 2 buttons. The second button should go to NewFile.html but it isn't working. my index.html main file consist of div tag inside it created 2 buttons and with id ForNext for one of the button.
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
Newpage.js
currentPage = {};
currentPage.init = function(){
WL.Logger.debug("NewFile :: init");
};
推荐答案
各种各样的问题,但主要的问题如下:
There are all sort of issues, but the main ones are the following:
- 在nextMethod()中,您试图将NewFile.html加载到按钮的ID中.那行不通:
$("#ForNext").load("pages/NewFile.html", function(){
它需要加载到pagePort
DIV中.将"ForNext"替换为"pagePort".
It needs to be loaded into the pagePort
DIV. Replace "ForNext" with "pagePort".
- 在
bba= WL.Client.getEnvironmen();
中,您缺少".getEnvironment"中的"t".
- In
bba= WL.Client.getEnvironmen();
, you are missing the "t" in ".getEnvironment".
这篇关于按钮在多页应用程序中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文