首页 > 代码库 > js中document.write()使用方法

js中document.write()使用方法

 <script>
             var hrf = window.location.href;
      
    if(hrf.indexOf(‘change‘)>0){
      document.write(‘<body>‘);
               document.write(‘恭喜发財‘);
      document.write(‘</body>‘);
    }else{
    document.write(‘<body background="images/jjkan/backgroundm.jpg" >‘);
       document.write(‘<label id="lmxj_deatil_1" style="position:absolute;left:10px;top:20px;text-align:left;background-color:#00000;color:#010101;width:330px;font-size:18px;" value="http://www.mamicode.com/1111" disabled>‘);
       if(isAdv==0){
      if(entityType=="channel"){      
      var sId = viewContent;
    //  target.innerHTML = ‘<AV id="movieWnd" serviceID="‘+sId+‘" name="movieWnd" style="position:absolute; border-width:0; left:5px; top:70px; //width:328px; height:244px;visibility: hidden;">‘;
     document.write(‘<AV id="movieWnd" serviceID="‘+sId+‘" name="movieWnd" style="position:absolute; border-width:0; left:5px; top:70px; width:328px; height:244px;">‘);
     movieWnd.play();
      }else{
      document.write(‘<div id="divNodeDescribeImg" style="position:absolute; border-width:0; left:5px; top:70px; width:328px; height:244px;"><img src = "http://www.mamicode.com/‘+viewContent+‘" width="339" height="275" border="0"/></div>‘);
      //target.innerHTML = ‘<img src = "http://www.mamicode.com/‘+viewContent+‘" width="339" height="275" border="0"/>‘; 
      }
    }else{
        //广告调用方式:通过节点的code(由生成页面的时候生成出来),调用广告系统中的js代码方式,返回广告代码
      document.write(‘<div id="tes" style="position:absolute; border-width:0; left:5px; top:70px; width:328px; height:244px;"><input id  = "showrs" type = "text"></input></div>‘);
      setInterval("timeout()",1000);
    //document.getElementById(‘aaa‘).value = "http://www.mamicode.com/aaa";
    //target.style.visibility ="visible";
    // document.write(‘<img src = "http://192.168.18.146/images/material/advert_epg.jpg" width="339" height="275" border="0"/>‘);
    //document.getElementById(‘aaa‘).value ="http://www.mamicode.com/bbb";

    }
           document.write(‘</body>‘);
    }
   
  </script>

js中document.write()使用方法