如何从web-inf文件夹jquery .load() [英] how to jquery .load() from web-inf folder

查看:132
本文介绍了如何从web-inf文件夹jquery .load()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我尝试从WebContent/js/jsFile.js中的文件中.load()WebContent/WEB-INF/jsp/jsp2.jsp中的文件,URL会如何显示

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

我尝试过

"../WEB-INF/jsp/file.jsp"

"../WEB-INF/jsp/file.jsp"

"/WEB-INF/jsp/file.jsp"

"/WEB-INF/jsp/file.jsp"

"WEB-INF/jsp/file.jsp"

"WEB-INF/jsp/file.jsp"

"/jsp/file.jsp"

"/jsp/file.jsp"

"jsp/file.jsp"

"jsp/file.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中呈现jspFile2.jsp.

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..

div screenView和listView是同级.

the div screenView and listView are siblings.

谢谢

推荐答案

我认为您写的第一个是正确的:

I think the first one you wrote is correct:

 "../WEB-INF/jsp/file.jsp"

如果您发布有关错误和代码的更多信息,我们可以提供更详细的答案(也许问题与您的想法有所不同)

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文件夹jquery .load()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆