Adding HTML to javascript

Source: Internet
Author: User
Tip: you can modify some code before running

<html><head><title>Adding HTML to javascript</title><style type="text/css"><!--body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 4px; margin-right: 0px}A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none } A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }--></style><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body><br><br><center><font color=red face="隶书" size=6>Adding HTML to javascript</font></center><br><center><table border=0 bordercolor=#111111 borderlight=green cellpadding="0" cellspacing="0"><tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>In the script display area</strong></font></td></tr><tr><td align=center height=80><SCRIPT LANGUAGE="JavaScript"><!--Hide JavaScript from Java-Impaired Browsersvar ls="";var dq='"';var sq="'";var rr="r";function jsPars(){ ls=document.isn.txt.value; if (ls==""){ alert("I'm sorry. I don't find any text pasted into the text window"); } else{ htmlPar(); } }function htmlPar(){ document.isn.txt.value="Working......."; pos=ls.indexOf(dq); pos1=ls.indexOf(sq); if ((pos>-1)&&(pos1>-1)){ reWrt(); } if (pos>-1){ qt=sq; } else{ qt=dq; } while (ls.indexOf(rr)>-1){ lc=ls.indexOf(rr); ls=ls.substring(0,lc)+" "+ls.substring(lc+1,ls.length); } nls="<SCRIPT LANGUAGE="+qt+"JavaScript"+qt+">"+rr +"<!-- Hide from JavaScript-Impaired Browsers"+rr +" document.write("+qt+ls.substring(0,36)+qt; ls=ls.substring(36,ls.length); lsl=ls.length pp=50; if (pp>lsl) { pp=lsl; } while (lsl>0){ nls+="r +"+qt+ls.substring(0,pp)+qt; ls=ls.substring(pp,lsl); lsl=ls.length; if (pp>lsl){ pp=lsl; } } nls+=");"+rr+"// End Hiding -->"+ Rr +"</sC" +"RIPT>"; Document.isn.txt. value = nls + rr +"<!-- Size: "+nls.length +" bytes -->"+ Rr;} function reWrt () {pos =-1; while (ls. indexOf (dq)>-1) {lc = ls. indexOf (dq); ls = ls. substring (0, lc) + sq + ls. substring (lc + 1, ls. length) ;}} function iA () {this. length = iA. arguments. length; for (var I = 0; I<this.length;i++){ this[i]=iA.arguments[i]; }}// End Hiding --> </sCRIPT><FORM NAME="isn"><TABLE BORDER=0 WIDTH=486><TR><TD><DIV ALIGN="center"><INPUT TYPE="button" NAME="but" VALUE=" Submit When Your HTML Has Been Pasted Below " onClick="jsPars()"></dIV><P><TEXTAREA NAME="txt" ROWS=20 COLS=75>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.