ExtJS 中JS页面如何调用另外一个XX.jsp页面javascript中的方法?
展开全部
jsp页面中调用javascript方法,可以直接写在标签的onclick属性,如下示例:
<html>
<head>
<script src="debuggap.js" type="text/javascript"></script>
<script type="text/javascript">
var startTop = 120;
var startPos = 1;
var totalNum = 0;
var itemHeight = 40;
var con1 = '';
function updateHtml(type, type2) {
totalNum = window.programList.size();
//初始化页面
totalNum = programList.size();
for (i = 0; i < totalNum; i++) {
con1 += programList.get(i).getId()
+ programList.get(i).getName();
}
var Book =
{
Name: programList.get(0).getId()
};
document.getElementById("content").innerHTML = "弹出对话框,测试" + type
+ type2 + "测试" + totalNum + con1+Book.Name;
alert("dialog");
}
</script>
</head>
<body>
这是一个js与android的例子
<a onClick="window.ceshi.updateHtml()" href="">弹出对话框</a> 调用JavaScript方法
<span id="content"></span>
</body>
</html>
<html>
<head>
<script src="debuggap.js" type="text/javascript"></script>
<script type="text/javascript">
var startTop = 120;
var startPos = 1;
var totalNum = 0;
var itemHeight = 40;
var con1 = '';
function updateHtml(type, type2) {
totalNum = window.programList.size();
//初始化页面
totalNum = programList.size();
for (i = 0; i < totalNum; i++) {
con1 += programList.get(i).getId()
+ programList.get(i).getName();
}
var Book =
{
Name: programList.get(0).getId()
};
document.getElementById("content").innerHTML = "弹出对话框,测试" + type
+ type2 + "测试" + totalNum + con1+Book.Name;
alert("dialog");
}
</script>
</head>
<body>
这是一个js与android的例子
<a onClick="window.ceshi.updateHtml()" href="">弹出对话框</a> 调用JavaScript方法
<span id="content"></span>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询