javascript 页面跳转语句
javascript页面跳转常用代码
按钮式:
<INPUT name="pclog" type="button" value="GO" onClick="location.href='http://www.163.com'">
或者
<input type="button" value="重新购买" onclick="return goBack();"/>
<script language="javascript">
function goBack(){
history.go(-3);
}
</script>
链接式:
<a href="javascript:history.go(-1)">返回上一步</a> //-1可以根据情况指定;
<a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
直接跳转式:
<script>window.location.href='http://www.163.com.cn';</script>
开新窗口:
<a href="javascript:" onClick="window.open('http://www.163.com','','height=500,width=611,scrollbars=yes,status=yes')">十分方便</a>
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/Peter_K/archive/2007/01/29/1497226.aspx
相关文档:
1.document.formName.item('itemname')的问题
说明:IE下可以使用document.formName.item('itemname')和document.formName.elements('elementsName');
FF下只能使用docuement.formName.elements('elementsName');
解决方法:统一使用docuement.formName.elements('elementsName');
2.集合类对象问题
说明:IE下可以使用[]和 ......
日前做项目,需要把页面的JS代码抽出来放到一个.js文件中,由于flex程序是以div+SWFObject的方式嵌入到页面的,为了达到目标网站只需要引用一个.js文件即实现引用项目工程的目的,所以也要把SWFObject的代码放到.js文件中。
思路是用document.write()把引用swf文件的代码写进页面,然后把flex要调用的js函数都放到.j ......
<script language="javascript" type="text/javascript">
// <!CDATA[
function Test()
{
document.location.href = 'test. ......
with(document)
{
write ("test");
write
("dsasfda");
}
上面是用了with
如果不用的话就要这样写了
document.write (" ......
.net中前台javascript与后台c#相互调用
C#代码与javaScript函数的相互调用
问:
1.如何在JavaScript访问C#函数?
2.如何在JavaScript访问C#变量?
3.如何在C#中访问JavaScript的已有变量?
4.如何在C#中访问JavaScript函数?
问题1答案如下:
javaScript函数中执行C# ......