示例 2 : login.jsp
");
window.frames["iframe_show378"].document.write(decodeHtml($("textarea#stepcodeTextarea378").val()));
window.frames["iframe_show378"].document.close();
$(window.frames["iframe_show378"]).load(function(){
$("#iframe_show378").height($("#iframe_show378").contents().find("body").height()+showittryitheight);
});
$("#iframe_show378").height($("#iframe_show378").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
");
window.frames["iframe378"].document.write(decodeHtml(code378));
window.frames["iframe378"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe378"]).load(function(){
$("#iframe378").height($("#iframe378").contents().find("body").height()+showittryitheight);
});
$("#iframe378").height($("#iframe378").contents().find("body").height()+showittryitheight);
alreadyWriteCode378 = code378;
$("#rendering378").hide();
$("#rendered378").show();
}
var tRereshRetry2DemoPanel378 = setInterval(rereshRetry2DemoPanel378,1000);
var binded378 = false;
$("textarea#stepcodeTextarea378").keyup(function(){
if(!binded378){
$(window).bind('beforeunload',function(){
binded378 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code378 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code378!=newCode){
// window.frames["iframe378"].document.write("<form action="/study/login.jsp">
账号:<input type="text" name="name"> <br/>
密码:<input type="password" name="password" > <br/>
<input type="image" src="http://127.0.0.1/example.gif">
</form>
<form action="/study/login.jsp"> 账号:<input type="text" name="name"> <br/> 密码:<input type="password" name="password" > <br/> <input type="image" src="http://127.0.0.1/example.gif"> </form> <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false"%>
<%
request.setCharacterEncoding("UTF-8");
String name = request.getParameter("name");
String password = request.getParameter("password");
%>
您提交的账号名是 :<%=name%> <br/>
您提交的密码是 :<%=password%>
<br>
<a href="javascript:history.back()">返回</a>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%> <% request.setCharacterEncoding("UTF-8"); String name = request.getParameter("name"); String password = request.getParameter("password"); %> 您提交的账号名是 :<%=name%> <br/> 您提交的密码是 :<%=password%> <br> <a href="javascript:history.back()">返回</a>
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
![]() |