以下内容转自:https://blog.csdn.net/qq_16071145/article/details/51341052 springMVC中通过ModelAndView进行后台与页面的数据交互,那么如何在页面中获取ModelAndView绑定的值呢? 1.在JSP中通过EL表达式进行获取(比较常用) 后台:ModelAndView model = new ModelAndView(); model.addObject("name","Jims");
3.页面中获取 iframe 中的值 var obj=document.getElementsByClassName(".ke-edit-iframe").contentWindow; var obj1=obj.document.getElementsByClassName(".ke-content"); var val=eval(obj1).html();
在HTML页面获取项目根路径的方法: function getRootPath(){ var curPageUrl = window.document.location.href; var rootPath = curPageUrl.split("//")[0] + curPageUrl.split("//")[1].split("/")[0] + curPageUrl.split("//")[1].split("/