<div class="codetitle"> <span><a style="CURSOR: pointer" data="46403" class="copybut" id="copybut46403" onclick="doCopy('code46403')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code46403"> <br>//開啟新頁並利用post方式傳遞參數function openNewPageWithPostData(postAddress,opentype,paramNames,paramValues) <br>{ <br>var newWindow = window.open(postAddress,opentype); <br>if (!newWindow) <br>{ <br>{ <br>; } <br><br>var postDataHtml=""; <br>postDataHtml = postDataHtml "<form id="postDataForm" method="post" action="%22%20postAddress%20%22">"; <br><br>if (paramNames && paramValues && (paramNames.length == paramValues.length)) <br>{ <br>for(var i=0 ; i<paramnames.length i>{ <br>postDataHtml = postDataHtml "<input type="hidden" name='" paramNames[i] "' value='" paramValues[i] "'>"; <br>} <br>} <br><br>postDataHtml = postDataHtml "</paramnames.length> </form> <script type="text/javascript"> document.getElementById("postDataForm").submit()<script><body><html>"; <br> newWindow.document.write(html); <BR>return newWindow; <BR>} <BR><BR></script> </div>