
码一:
<script>
function selecturl(){
z=documentbodycreateTextRange();
zmoveToElementText(selecturlDiv);
zselect();
}
</script>
<span onmousemove='selecturl()' id=selecturlDiv><script>documentwrite(locationhref)</script>
代码二:
<script>
function copyCode(o){oselect();var js=ocreateTextRange();jsexecCommand("Copy");alert("复制成功!");}
documentwrite("<table align=center class=tableborder1 cellpadding=1 cellspacing=0><tr>");
documentwrite("<td width=10% nowrap class=tablebody1>本页URL地址(双击复制):</td>");
documentwrite("<td class=tablebody1><textarea onfocus=thisselect() style='width:100%;overflow-y:visible;' ondblclick=copyCode(this) rows=1>");
documentwrite(selflocation+"</textarea></td></tr></table>");
</script>
代码三:
<script language="javascript">
<!--
function copyToClipBoard(){
var clipBoardContent=documentlocation;
clipBoardContent+='\r\n';
windowclipboardDatasetData("Text",clipBoardContent);
alert("耶!复制成功喽!你可以粘贴在QQ消息里送给你的好朋友呀!再次感谢你对 的支持哦!");
}
//-->
</script>
<script language='javascript'>
documentwrite("<img src=\"templates//images/dbgif\" width=\"49\" height=\"17\">");
documentwrite("<input size=\"60\" value=\""+documentlocation+"\"><input type=\"button\" value=\"推荐给朋友\" title=\"点击复制地址到剪贴板,直接在MSN/QQ上粘贴即可\" onclick=\"copyToClipBoard()\">");
</script>
Jquery跳转页面传递参数以及获取url的参数的方法总结
传递参数: windowlocation='editCoursehtmldataId='+dataId+'';
获取url中的参数(封装的方法):
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&])(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = windowlocationsearchsubstr(1)match(reg); //匹配目标参数
if (r != null) return unescape(r[2]);
return null; //返回参数值
}
使用: var dataId = getUrlParam("dataId")
Location 对象
Location 对象包含有关当前 URL 的信息。
Location 对象是 Window 对象的一个部分,可通过 windowlocation 属性来访问。
在ASP中关于返回上一页的实现方法:
//这个大家都不陌生吧
1windowhistorygo(-1)
//若在表单中通过按钮返回上一页,则用:
2onclick="javascript:historygo(-1)"
//我最近在写程序的时候常用到这行代码!返回上一页并刷新!
3Responseredirect(requestservervariables(">
以上就是关于获得静态页面url地址全部的内容,包括:获得静态页面url地址、Jquery跳转页面传递参数以及获取url的参数、在javaScript中使用window对象的什么方法可以取得有关当前url的信息等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)