美图秀秀超能力的javascript,求解,图片从哪里调出来,http://8.app.meitu.com
</div><script language="javascript">
var xmlHttp;
function S_xmlhttprequest() {
if(window.ActiveXObject) {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
} else if(window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function $(obj){return document.getElementById(obj)}
var urlinfo=window.location.href; //获取当前页面的url
var len=urlinfo.length;//获取url的长度
var offset=urlinfo.indexOf("##");//设置参数字符串开始的位置
var newsidinfo;
if(offset>0){
newsidinfo=urlinfo.substr(offset+2,len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
var offset1=newsidinfo.indexOf("&*");//设置参数字符串开始的位置
var sucai=newsidinfo.substr(0,offset1);
var offset2=newsidinfo.indexOf("&&");//设置参数字符串开始的位置
var url=newsidinfo.substr(offset2+2,len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
var testname=newsidinfo.substr(offset1+2,offset2-offset1-2);
$('avata').src=url;
$('weibo').href='weibo.php?source=sina&sucai='+sucai+'&testname='+testname+'&url='+url;
$('qqweibo').href='qqweibo.php?source=sina&sucai='+sucai+'&testname='+testname+'&url='+url;
}
function change(){
S_xmlhttprequest();
username=$('userName').value;
if(username.length==0||username=='请输入你的名字'||username.replace(/[ ]/g,"")==''){
alert('请输入您的名字');
return false;
}
var reg = /^[\u4e00-\u9fa5]+$/;
if(reg.test(username))
{
if(username.length>8){
alert('请输入的小于8个字的中文名字');
return false;
}
}
username=username.replace(/\'/ig,"‘");
xmlHttp.onreadystatechange = function(){if(xmlHttp.readyState == 4 ){
if(xmlHttp.status == 200) {
var data = xmlHttp.responseText;
//var obj = eval( "(" + data + ")" );
var obj = new Function("return" + data)();//转换后的JSON对象
var result=obj.result;
if(result=="false"){
alert("该名字不在河蟹范围内,无法生成");
return false;
}
else if(result=="false1"){
alert("输入的名字太长");
return false;
}
else{
var returnpay=obj.url;
var sucai=obj.sucaiid;
$('avata').src=returnpay;
$('weibo').href='weibo.php?source=sina&sucai='+sucai+'&testname='+encodeURI(username)+'&url='+returnpay;
$('qqweibo').href='qqweibo.php?source=sina&sucai='+sucai+'&testname='+encodeURI(username)+'&url='+returnpay;
return false;
}
}
}
};
xmlHttp.open("post","mkimg.php",true)
var sendDate ="username="+username;
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send(sendDate);
return true;
}
function CopyImage(img)
{
if (img.tagName != 'IMG') return;
if (typeof img.contentEditable == 'undefined' || !document.body.createControlRange){
alert('抱歉您的浏览器不支持直接复制图片,请在图片上点击右键“复制”');
}
else{
var ctrl = document.body.createControlRange();
img.contentEditable = true;
ctrl.addElement(img);
ctrl.execCommand('Copy');
img.contentEditable = false;
alert('图片复制成功\n\n直接在QQ聊天窗口粘贴(Ctrl+V)即可');
}
}
</script>
<div style="display:none"><script src="http:// language="JavaScript"></script></div>