返回信息流Android 的 webview 控件,对url有要求吗?
最近做一个应用,用webview显示淘宝客的url,比如 http://s.click.taobao.com/t_8?e=7HZ6jHSTbIQy6E88z%2FsvcqNzNPcynj0AkKX9Tn%2F2RUNWOMIupayAWn3aM9DUg6YHuICQP60StGEAZn1g8C%2B%2FCixdZDbwyN0g3DcKI1TLFy6UTKQ%3D&p=mm_21132466_0_0&n=19
load这个url之后在两个中间页面之间不断循环了。。。。。。。。
求助啊
这是一条镜像帖。来源:北邮人论坛 / mobile-internet / #3072同步于 2012/4/10
该镜像源已超过 30 天没有更新,可能在源站已被删除。
MobileInternet机器人发帖
[求助]webView问题
aa7189254
2012/4/10镜像同步1 回复
订阅后,新回复会通过你的通知中心匿名送达。
1 条回复
function htmlspecialchars(str){
str = str.replace(/</g, '<');
str = str.replace(/>/g, '>');
str = str.replace(/"/g, '"');
str = str.replace(/'/g, ''');
return str;
}
function bol(){
var inf = (top.location!=self.location);
var qs = location.search.split("?")[location.search.split("?").length-1].split("&");
qso = {};
for(var i=0;i<qs.length;i++){
if(qs[i]=="")continue;
var tmpa = qs[i].split("=");
qso[tmpa[0]] = tmpa[1]?tmpa[1]:"";
}
var tu = unescape(qso.tu);
if(htmlspecialchars(tu).length != tu.length){
exit;
}
if(inf){
var oi = document.createElement("iframe");
oi.id="iobj"
oi.border=0;
oi.frameBorder=0;
oi.style.height="1px"
oi.style.width="1px"
document.body.appendChild(oi);
var cd = oi.contentWindow.document;
cd.write('<ht'+'ml><bo'+'dy style="margin:0px;padding:0px"></scr'+'ipt><scr'+'ipt src="http://js.tongji.linezing.com/1023331/tongji.js" type="text/javascript"></scr'+'ipt><noscr'+'ipt><a href="http://www.linezing.com"><img src="http://img.tongji.linezing.com/1023331/tongji.gif"/></a></noscr'+'ipt></bo'+'dy></ht'+'ml>');
window.setTimeout(function(){cd.close();if(qso.tu)location.href = unescape(qso.tu);},1000);
}else{
if(qso.co&&qso.co!=""){
document.cookie="tk_trace="+(qso.co)+";path=/;domain=.taobao.com";
}
if(qso.tu && (qso.tu.indexOf("http%3A%2F%2Fs.click.taobao.com%2F")===0 || qso.tu.indexOf("http%3A%2F%2Fs.click.alimama.com%2F")===0
|| qso.tu.indexOf("http%3A%2F%2Fitem8.taobao.com%2F")===0 || qso.tu.indexOf("http%3A%2F%2Fshop8.taobao.com%2F")===0)){
if(!window.attachEvent){
document.write('<input style="display:none" type="button" id="exe" value="" onclick="window.location=\''+unescape(qso.tu)+'\'">');
document.getElementById('exe').click();
}else{
document.write('<a style="display:none" href="'+unescape(qso.tu)+'" id="exe"></a>');
document.getElementById('exe').click();
}
}
}
}//end of bol()
bol();
看源码...
【 在 aa7189254 的大作中提到: 】
: Android 的 webview 控件,对url有要求吗?
:
: 最近做一个应用,用webview显示淘宝客的url,比如 http://s.click.taobao.com/t_8?e=7HZ6jHSTbIQy6E88z%2FsvcqNzNPcynj0AkKX9Tn%2F2RUNWOMIupayAWn3aM9DUg6YHuICQP60StGEAZn1g8C%2B%2FCixdZDbwyN0g3DcKI1TLFy6UTKQ%3D&p=mm_21132466_0_0&n=19
: ...................