弱弱的问一下,js如何获取当前项目的根路径?
弱弱的问一下,js如何获取当前项目的根路径?就是类似于http://localhost:8080/,小菜求大神指教。还有啊,我在js中写了如下的代码
fm.action = '/prpall/processPolicyBatchPrint.do?actionType=queryPolicyDocumentType';这个submit之后还能再写一个类似的么,就是说我想让一个方法提交两次,就是action不同。
fm.target='_parent';
fm.submit();
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
var basePath = '<%=basePath%>';
alert(basePath); //http://localhost:8080/
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
request.setAttribute("basePath", basePath);
var basePath = ${'basePath'};
alert(basePath); //http://localhost:8080/