HTML 페이지에서 ASP처럼 매개변수를 적용하는 방법

1105 단어
 
  
<br>var pos, str, para, parastr, tempstr1; <br>tempstr = ""; <br>str = window.location.href; <br>pos = str.indexOf("?")parastr = str.substring(pos + 1); <br>document.write("<br> :" + str); <br>if (pos > 0) <br>{ <br>document.write("<br> :" + parastr); <br>} <br> <br>else <br>{ <br>document.write(" "); <br>} <br> <br> <br>if (str.indexOf("&") > 0) <br>{ <br>para = parastr.split("&"); <br>for (i = 0; i < para.length; i++) <br>{ <br>    tempstr1 = para[i]; <br> <br>    pos = tempstr1.indexOf("="); <br>    //document.write (tempstr1.substring(0,pos)); <br>    document.write("<br> " + i + ":" + tempstr1.substring(0, pos)); <br>    document.write(" :" + tempstr1.substring(pos + 1)); <br>} <br>} <br>

좋은 웹페이지 즐겨찾기