1
我是全新的JavaScript。我试图从我的jsp.Its不工作调用一个javaScript函数。我试图通过bugzila进行调试。它说“此页面上没有Javascript”调用外部javascript函数frm JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4 /loose.dtd">
<html>
<script type="text/javascript" src="ajaxs.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<%
out.println("Bismillahir Rahmanir Rahim");
%>
<jsp:useBean id="numBean" class="beans.NumberBean">
<jsp:setProperty name="numBean" property="*" />
</jsp:useBean>
<form action="index.jsp" method="post">
<table>
<tr>
<td>Enter Integers:</td>
<td><input type="text" id="inputString" name="inputString"
value="<jsp:getProperty name="numBean" property="inputString" />"
/> </td>
<td>(Use semi-colon to separate number)</td>
</tr>
<tr>
<td>M - number of largest element to find.:</td>
<td>
<input type="text" id="nthHighest" name="nthHighest"
value="<jsp:getProperty name="numBean" property="nthHighest" />" />
</td>
</tr>
</table>
<input type="submit" value="Identify" onclick="ajaxFunction()" />
<div id="result"></div>
</form>
</body>
</html>
我想在onclick事件上调用“ajaxFunction()”。 我包括js文件的顶部以下内容:提前 <script type="text/javascript" src="ajaxs.js"></script>
ü可以请帮我找出我做错了什么在这里...
感谢
查看此JSP生成的页面时,浏览器地址栏中显示的URL是什么?和这个URL相关的ajaxs.js文件在哪里?您在Firefox控制台中是否有任何错误? – 2013-03-03 16:54:00
您的ajaxs.js可能不在此处提及的路径中。尝试使用一些HTTP监控工具来检查是否实际下载了ajaxs.js。 – hop 2013-03-03 16:59:44