62,040
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script id="a" type="text/javascript" ></script>
<script type="text/javascript">
function s()
{
document.getElementById("a").src="Abc.aspx?v="+document.getElementById("tx").value;
abc();
}
</script>
</head>
<body>
<input type="text" id="tx">
<input type="button" onclick="s()" value="确定">
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Abc.aspx.cs" Inherits="Default2" %>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("function abc(){alert('"+Request.QueryString["v"]+"')}");
}
}
document.getElementById("a").src="Abc.aspx?v="+document.getElementById("tx").value;
function f()
{
document.getElementById("a").src="Abc.aspx?v="+document.getElementById("tx").value;
a();
}
function a()
{
timer=setTimeout("a()",50);
if((typeof js)+""!="undefined")
{
abc();
//
clearTimeout(timer);
js=undefined;
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("function abc(){alert('"+Request.QueryString["v"]+"')}");
Response.Write("var js='js'");
}
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
function s() {
replaceScript('a', "JavaScript.aspx?v=" + document.getElementById("tx").value);
}
function callBack() {
abc();
}
function replaceScript(id, src) {
var newScript = document.createElement('script');
var oldScript = document.getElementById(id);
newScript.type = "text/javascript";
newScript.src = src;
newScript.id = id;
document.getElementById('div').replaceChild(newScript, oldScript);
}
</script>
</head>
<body>
<div id="div">
<script id="a" type="text/javascript"></script>
</div>
<input type="text" id="tx">
<input type="button" onclick="s()" value="确定">
</body>
</html>