zoukankan      html  css  js  c++  java
  • jstl嵌套JavaScript

    问题说明:在jsp中会通过后台传值来判断是否关闭dialog,并且可能需要往弹出的父窗体传值,父窗体可能是一个iframe,因此需要使用在jstl判断后台传值,插入JavaScript代码向父窗体传值。

        <!--jstl中使用test判断后台传值-->
        <c:if test="${pd.state == 1 }"> 
        
    		<span class="green">更新成功</span>
    		<input id="NEWPIC" type="hidden" value="${pd.LIVEPICURL}"/>
    
    		<script type="text/javascript">
    
    			var pic = $("#NEWPIC").val();
    			
                //获取当前父窗体,如果多个iframe最好使用id来进行筛选
    			var tops = $("#panel iframe:visible",window.parent.document)[0];
                //切记,iframe要使用contentWindow.document来获取document		
    			var topFrame= $(tops.contentWindow.document).find("#LiveImageURL").attr("name",pic);
    
    		</script>
    
    	</c:if>
    
  • 相关阅读:
    django初识
    django前奏
    前端之bootstrap
    前端之jQuery
    前端基础之BOM和DOM操作
    前端之js
    前端之css(二)
    前端之css(一)
    html之form表单
    前端之html
  • 原文地址:https://www.cnblogs.com/a8167270/p/5112748.html
Copyright © 2011-2022 走看看