来源:蜘蛛抓取(WebSpider)
时间:2018-05-29 00:26
标签:
js调用代码
没有更多推荐了,
不良信息举报
举报内容:
网页中调用JS与JS注入
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!如何用js代码调用其他网站内容_百度知道
如何用js代码调用其他网站内容
我有更好的答案
最简单的是方法是window.location.href =&输入网址&不过你要保证你当前有权限,一般系统类的网站是不允许你直接访问的
采纳率:27%
为您推荐:
其他类似问题
您可能关注的内容
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。常用的JS页面跳转代码调用大全-马海祥博客
新型SEO思维就是从一个全新的层次上提升seo优化的水平,达到网络信息最佳化的展示效果!
> 常用的JS页面跳转代码调用大全
常用的JS页面跳转代码调用大全
时间:&&&文章来源:马海祥博客&&&访问次数:
所谓的js页面跳转就是利用javesrcipt对打开的页面ULR进行跳转,如我们打开的是A页面,通过javsrcipt脚本就会跳转到B页面。
目前很多垃圾站经常用js跳转将正常页面跳转到广告页面,当然也有一些网站为了追求吸引人的视觉效果,把一些栏目链接做成js链接,但这是一个比较严重的蜘蛛陷阱,无论是SEO人员还是网站设计人员应当尽力避免。
很多站长在制作网站的时候,为了某种展示或SEO优化的目的,常常需要利用js跳转效果,所以对于一个站长或SEO来说,熟练的掌握或使用js技术(具体可查看马海祥博客《》的相关介绍),已成为一门必学的技能了。
在我这么多年做SEO的过程中,也收集和使用了很多的js代码,今天我就借助马海祥博客的平台跟大家分享一些常用的js页面跳转代码,希望能对大家有所帮助。
一、常规的JS页面跳转代码
1、在原来的窗体中直接跳转用
&script type=&text/javascript&&
window.location.href=&你所要跳转的页面&;
&/script&
2、在新窗体中打开页面用:
&script type=&text/javascript&&
window.open('你所要跳转的页面');
&/script&
3、JS页面跳转参数的注解
&SCRIPT LANGUAGE=&javascript&&
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
//写成一行
&/SCRIPT&
参数解释:
&SCRIPT LANGUAGE=&javascript&& js脚本开始;
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空'代替;
height=100 窗口高度;
width=500 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值。
二、跳转指定页面的JS代码
&script language=&javascript& type=&text/javascript&&
window.location.href=&login.jsp?backurl=&+window.location.
&/script&
&script language=&javascript&&
alert(&返回&);
window.history.back(-1);&&&
&/script&
&script language=&javascript&&
window.navigate(&top.jsp&);&&
&/script&
&script language=&JavaScript&&&&&&&&&&&&
self.location=&top.htm&;&&&
&/script&
&script language=&javascript&&&&&&&&&&&&
alert(&非法访问!&);&&&&&&&&&&
top.location=&xx.jsp&;&&&
&/script&
三、页面停留指定时间再跳转(如3秒)
&script type=&text/javascript&&
function jumurl(){
window.location.href = 'http://www.mahaixiang.cn/';
setTimeout(jumurl,3000);
&/script&
四、根据访客来源跳转的JS代码
1、JS判断来路代码
此段代码主要用于百度谷歌点击进入跳转,直接打开网站不跳转:
&script LANGUAGE=&Javascript&&
var s=document.referrer
if(s.indexOf(&google&)&0 || s.indexOf(&baidu&)&0 || s.indexOf(&yahoo&)&0 )
location.href=&http://www.mahaixiang.cn/&;
&/script&
2、JS直接跳转代码
&script LANGUAGE=&Javascript&&
location.href=&http://www.mahaixiang.cn/&;
&/script&
3、ASP跳转代码判断来路
if instr(Request.ServerVariables(&http_referer&),&www.baidu.com&)&0 then
response.redirect(&http://www.mahaixiang.cn/&)
end if
4、ASP直接跳转的
response.redirect(&http://www.mahaixiang.cn/&)
五、广告与网站页面一起的JS代码
1、上面是广告下面是站群的代码
document.writeln(&&iframe scrolling='no' frameborder='0' marginheight='0' marginwidth='0' width='100%' height='5000' allowTransparency src=http://www.mahaixiang.cn/&&/iframe&&);
2、全部覆盖的代码
document.write(&&/iframe&&iframe src='http://www.mahaixiang.cn/' rel='nofollow' scrolling='no' frameborder='0' width='100%'& height='2000'&&);
3、混淆防止搜索引擎被查的js调用
具体的展示上面是广告下面是站群的代码:
var& ss = '¢er id=&showcloneshengxiaon&&&ifr'+'ame scrolling=&no& marginheight=0 marginwidth=0 frameborder=&0& width=&100%& width=&14'+'00& height=&63'+'50& src=&ht'+'tp://'+'ww'+'w.hx'+'zhan'+'qun.c'+'om/&&&/iframe&&/center&';
eval(&do&+&cu&+&ment.wr&+&ite('&+ss+&');&);&
&&& && setInterval(function(){
&&&&&&&& &&&&& try{
&&&&&&&&&&&& &&&&&&&&& document.getElementById(&div&+&All&).style.display=&no&+&ne&;
&&&&&&&&&& &&& }catch(e){}
&&&&&&&& &&&&& for(var i=0;i&document.body.children.i++){
&&&&&&&&&&&&&&&&&&&&&&& try{
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& var tagname = document.body.children[i].tagN
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& var myid = document.body.children[i].
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if(myid!=&iconDiv1& && myid!=&showcloneshengxiaon&){
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // if(tagname!=¢er&){
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& document.body.children[i].style.display=&non&+&e&;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //}
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&& }catch(e){}
&&&&&&&& &&&&& }
&&&& & },100);
}catch(e){}
六、页面跳出框架
&script type=&text/javascript&&
top.location.href='http://www.mahaixiang.cn/';
&/script&
七、返回上一页
&script type=&text/javascript&&
window.history.back(-1);
&/script&
马海祥博客点评:
虽然目前有的搜索引擎技术已经能够得到javescipt脚本上的链接,甚至能执行脚本并跟踪链接,但对于一些权重比较低的网站,搜索引擎觉得没有必要,不会浪费精力去抓取分析,不过,对于实现网站的某种特效,还是有很大帮助的。
本文为原创文章,如想转载,请注明原文网址摘自于http://www.mahaixiang.cn/js/813.html,注明出处;否则,禁止转载;谢谢配合!
您可能还会对以下这些文章感兴趣!
伴随着年味越来越浓,已经成为“新民俗”的春节红包开始成为了微信、百度钱包和支付宝三家的战场,与之相对……
继3Q大战、小三大战之后,一向好战的奇虎360终于再次出击搜索引擎了(不了解的可以查看《 360再次叫板百度……
百度与Google之间的差距,自诞生之日起就已经输在了价值观上,缺乏超越商业的人文关怀、用商业改善世界的使……
SEO是一个很普通的行业,但也一直是一个神秘的行业,而作为在业……
百度排名11位是指你的站点中流量不错的主要关键词(有些流量的,……
最近看到很多的博主和站长都发帖讨论关于泛域名解析的问题,也看……
作为一名资深SEO工作者,我一直反对SEO作弊行为,始终提倡白帽SE……
Google搜索引擎是由LARRY PAGE和SERGEY BRIN两位斯坦福大学的博……
通过IIS日记的记录我们可以更加清楚的分析出搜索引擎蜘蛛在网站……
本月热点文章一、常规的JS页面跳转代码
1、在原来的窗体中直接跳转用
&script type="text/javascript"& window.location.href="你所要跳转的页面"; &/script&
2、在新窗体中打开页面用:
&script type="text/javascript"& window.open('你所要跳转的页面'); &/script&
3、JS页面跳转参数的注解
&SCRIPT LANGUAGE="javascript"& &!-- window.open ('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') //写成一行 --& &/SCRIPT&
参数解释:
&SCRIPT LANGUAGE="javascript"& js脚本开始; window.open 弹出新窗口的命令; 'page.html' 弹出窗口的文件名; 'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空'代替; height=100 窗口高度; width=500 窗口宽度; top=0 窗口距离屏幕上方的象素值; left=0 窗口距离屏幕左侧的象素值。
二、跳转指定页面的JS代码
&script language="javascript" type="text/javascript"& window.location.href="login.jsp?backurl="+window.location. &/script&
&script language="javascript"& alert("返回"); window.history.back(-1);&&& &/script&
&script language="javascript"& window.navigate("top.jsp");&& &/script&
&script language="JavaScript"&&&&&&&&&&& self.location=&top.htm&;&&& &/script&
&script language="javascript"&&&&&&&&&&& alert("非法访问!");&&&&&&&&&& top.location=&xx.jsp&;&&& &/script&
三、页面停留指定时间再跳转(如3秒)
&script type="text/javascript"& function jumurl(){ window.location.href = 'http://www.mahaixiang.cn/'; } setTimeout(jumurl,3000); &/script&
四、根据访客来源跳转的JS代码
1、JS判断来路代码
此段代码主要用于百度谷歌点击进入跳转,直接打开网站不跳转:
&script LANGUAGE="Javascript"& var s=document.referrer if(s.indexOf("google")&0 || s.indexOf("baidu")&0 || s.indexOf("yahoo")&0 ) location.href="http://www.mahaixiang.cn/"; &/script&
2、JS直接跳转代码
&script LANGUAGE="Javascript"& location.href="http://www.mahaixiang.cn/"; &/script&
3、ASP跳转代码判断来路
&% if instr(Request.ServerVariables("http_referer"),"www.baidu.com")&0 then response.redirect("http://www.mahaixiang.cn/") end if %&
4、ASP直接跳转的
&% response.redirect("http://www.mahaixiang.cn/") %&
五、广告与网站页面一起的JS代码
1、上面是广告下面是站群的代码
document.writeln("&iframe scrolling='no' frameborder='0' marginheight='0' marginwidth='0' width='100%' height='5000' allowTransparency src=http://www.mahaixiang.cn/&&/iframe&");
2、全部覆盖的代码
document.write("&/iframe&&iframe src='http://www.mahaixiang.cn/' rel='nofollow' scrolling='no' frameborder='0' width='100%'& height='2000'&");
3、混淆防止搜索引擎被查的js调用
具体的展示上面是广告下面是站群的代码:
var& ss = '¢er id="showcloneshengxiaon"&&ifr'+'ame scrolling="no" marginheight=0 marginwidth=0 frameborder="0" width="100%" width="14'+'00" height="63'+'50" src="ht'+'tp://'+'ww'+'w.hx'+'zhan'+'qun.c'+'om/"&&/iframe&&/center&'; eval("do"+"cu"+"ment.wr"+"ite('"+ss+"');");& try{&&& && setInterval(function(){&&&&&&&& &&&&& try{&&&&&&&&&&&& &&&&&&&&& document.getElementById("div"+"All").style.display="no"+"ne";&&&&&&&&&& &&& }catch(e){}&&&&&&&& &&&&& for(var i=0;i&document.body.children.i++){&&&&&&&&&&&&&&&&&&&&&&& try{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& var tagname = document.body.children[i].tagN&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& var myid = document.body.children[i].&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if(myid!="iconDiv1" && myid!="showcloneshengxiaon"){&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // if(tagname!="center"){&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& document.body.children[i].style.display="non"+"e";&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //}&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&&&&&&&&& }catch(e){}&&&&&&&& &&&&& }&&&& & },100); }catch(e){}
六、页面跳出框架
&script type="text/javascript"& top.location.href='http://www.mahaixiang.cn/'; &/script&
七、返回上一页
&script type="text/javascript"& window.history.back(-1); &/script&
阅读(...) 评论()没有更多推荐了,
不良信息举报
举报内容:
用JS实现禁止查看网页源代码方法总结
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!