62,272
社区成员
发帖
与我相关
我的任务
分享<script>
function getCookie(c_name) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1) {
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1) c_end = document.cookie.length;
return unescape(document.cookie.substring(c_start, c_end));
}
}
return "";
}
function setCookie(c_name, value) {
document.cookie = c_name + "=" + escape(value);
}
function detectUrl(a) {
setCookie("link", a.href);
}
</script>
<a href="http://dotnet.aspx.cc" target="mainframe" onclick="detectUrl(this)">点击一</a>
<a href="http://www.g.cn" target="mainframe" onclick="detectUrl(this)">点击二</a>
<br /><br />
<script>
a = getCookie("link");
if (a == "") {
document.write('<iframe src="http://community.csdn.net/" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" id="ifm" name="mainframe" width="888px"></iframe>')
}
else {
document.write('<iframe src="' + a + '" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" id="ifm" name="mainframe" width="888px"></iframe>')
}
</script>