Javascript运行,但jquery不运行在eclipse 8.6上

javascript running but jquery not running on eclipse 8.6

本文关键字:运行 eclipse jquery Javascript      更新时间:2023-09-26

我已经尝试了一切,但简单的jquery功能,如不在我的JSP页面上运行

代码:<input type="button" id="expand3" value="Hide"/> <div id="result3">hide this</div>

jquery代码:

$("#expand3").click(function(){ $("#result3").hide(); });

jquery代码在主页面上,隐藏测试在从主页面调用的页面上

还有一件事……下面是主页

的代码

如果(probTitleKBaseId != " ")kbaseId = . getelementbyid("appProbTitle")value;

        var contextPath ="/"+(window.location+" ").split("/")[3];
        document.getElementById("KBInfo").innerHTML="";
        document.getElementById("message").style.display="";                        
        makeHttpRequest(contextPath+"/jsp/knowledgeBase/kbResults.jsp?app="+app+"&env="+env+"&ptitle="+ptitle+"&kbaseId="+kbaseId,getResponse,false);

我没有通过AJAX调用kbresults.jsp页面,按钮被放置在这个页面上,这可能是原因

你应该导入jquery库。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>