window.onload=function() { var mallchatdiv = document.createElement("div"); mallchatdiv.setAttribute("id", "mallfloat"); mallchatdiv.setAttribute("style", "position:fixed;bottom:400px;right:5px;width:50px;height:100px;cursor:pointer;"); var goMallChatButton = document.createElement("img"); goMallChatButton.setAttribute("src","http://admin.appkefu.com/AppKeFu/float/web/img/float.png"); mallchatdiv.appendChild(goMallChatButton); document.body.appendChild(mallchatdiv); goMallChatButton.onclick=function(){ var chaturl = "http://free.appkefu.com/AppKeFu/float/web/chat.php?wg=" +"soujiayizaixiankefu" +"&goods="+"" +"&goodspic="+"" +"&goodsname="+"" +"&goodsprice="+"" +"&goodsurl="+"" +"&postscript="+"" +"&hidenav="+"" +"&title="+"" +"&logopic="+"" +"&hideavatar="+"" +"&kefuavatar="+"" +"&robot="+"false"; window.open(chaturl,'','left=300,top=50,width=650,height=700'); } }