欢迎光临
我们一直在努力

贴一段可以近视替代remote script的代码,或许有人用得着。

建站超值云服务器,限时71元/月

这个资料是以前收集的,希望能对你有所帮助。

1、page1.htm

<html>

<head>
</head>

<body>
    <form id=scr_data>
        first name: <input type=text id=s_fname value="none">
        <br>
        last name: <input type=text id=s_lname value="none">
        <br><br>
        <input type=hidden id=s_hidden value="no value assigned yet!">
        1. <input type=button id=btn_callremotescripting0 onclick="alert(before remote scripting: + scr_data.s_hidden.value)" value="display hidden text box value"><br>
        2. <input type=button id=btn_callremotescripting1 onclick="callremotescript1()" value="change first name, last name & hidden textbox values (calls an asp page)"><br>
        3. <input type=button id=btn_callremotescripting2 onclick="alert(after remote scripting: + scr_data.s_hidden.value)" value="display hidden text box value (after remote scripting)"><br>
        4. <input type=button id=btn_callremotescripting3 onclick="callremotescript2()" value="clear first & last name values but keep hidden text value (calls a html page)"><br>
    </form>
</body>

<script language=javascript>
//you can either use javascript or vbscript…
//you can also call an asp or html page…

var t = dialogleft:1024;dialogtop:768;dialogheight:0;dialogwidth:0;center:no;edge:raised; +
        help:no;show=no;resizable:no;status:no;scroll:no;unadorned:yes

function callremotescript1()
{
    var s = "remotescript1.asp"

    /*
    t = window properties
    s = page to call (asp or html)
    scr_data = your form id/name (*be sure to pass this parameter*)
    */
    self.showmodaldialog(s, scr_data, t);
}

function callremotescript2()
{
    var s = "remotescript2.htm"

    /*
    t = window properties
    s = page to call (asp or html)
    scr_data = your form id/name (*be sure to pass this parameter*)
    */
    self.showmodaldialog(s, scr_data, t);
    alert(neat eh?);
}
</script>

</html>

2、remotescript1.asp

<%@ language=vbscript %>

<%
dim asp_var_fname
dim asp_var_s_lname

asp_var_fname = "john"
asp_var_lname = "doe"
%>

<html>

<body>
</body>

<script language=vbscript>
set f_reference = window.dialogarguments
f_reference.s_fname.value = "<%=asp_var_fname%>"
f_reference.s_lname.value = "<%=asp_var_lname%>"
f_reference.s_hidden.value = "this is now the new value of the hidden textbox"
self.close()
</script>

</html>

3、remotescript2.htm

<html>

<body>
</body>

<script language=vbscript>
set f_reference = window.dialogarguments
f_reference.s_fname.value = ""
f_reference.s_lname.value = ""
self.close()
</script>

</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 贴一段可以近视替代remote script的代码,或许有人用得着。
分享到: 更多 (0)