如何从 web-inf 文件夹中加载 jquery .load()
WebContent/js/jsFile.js 中的文件 .load() WebContent/WEB-INF/jsp/jsp2.jsp 中的文件,网址会是什么样子
如果我尝试从我尝试过的
“../WEB-INF/jsp/file.jsp”
“/WEB-INF/jsp/file.jsp”
“WEB-INF/jsp/file.jsp”
“/jsp/file.jsp”
“jsp/文件.jsp”
编辑:
$("#Submit").live({
click: function(){
$("#listView").fadeOut(1000, function(){
});
$("#screenView").load({
url: "../WEB-INF/jsp/jspFile2.jsp",
complete: function(){
alert("completed");
}
});
}
});
这是我用来从 WEB-INF/jsp/jspFile1.jsp 加载的代码。它不会在screenView div 正如我所期待的那样..
div screenView 和 listView 是兄弟姐妹。
谢谢,
文恩
How would the url look if I'm trying to .load() a file in WebContent/WEB-INF/jsp/jsp2.jsp from a file in WebContent/js/jsFile.js
I've tried
"../WEB-INF/jsp/file.jsp"
"/WEB-INF/jsp/file.jsp"
"WEB-INF/jsp/file.jsp"
"/jsp/file.jsp"
"jsp/file.jsp"
Edit:
$("#Submit").live({
click: function(){
$("#listView").fadeOut(1000, function(){
});
$("#screenView").load({
url: "../WEB-INF/jsp/jspFile2.jsp",
complete: function(){
alert("completed");
}
});
}
});
This is the code I'm using to load from WEB-INF/jsp/jspFile1.jsp.. It's not rendering the jspFile2.jsp in the screenView div as I was expecting..
the div screenView and listView are siblings.
Thanks,
wenn
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您写的第一个是正确的:
如果您发布有关错误和代码的更多信息,我们可以提供更详细的答案(也许问题与您的想法不同)
I think the first one you wrote is correct:
if you post more info about the error and your code we could provide a more detailed answer (maybe the problem is different from what you think)
../WEB-INF/jsp/file.jsp 是正确的,您一定遇到了另一个问题。尝试将浏览器重定向到该文件并查看它是否显示。
../WEB-INF/jsp/file.jsp is correct, you must be having another problem. try redirecting the browser to the file and see if it shows up.