<div class="codetitle"> <span><a style="CURSOR: pointer" data="46403" class="copybut" id="copybut46403" onclick="doCopy('code46403')"><u>Copier le code</u></a></span> Le code est le suivant :</div> <div class="codebody" id="code46403"> <br>//Ouvrez une nouvelle page et utilisez la méthode de publication pour passer paramètres<br>function openNewPageWithPostData(postAddress,opentype,paramNames,paramValues) <br>{ <br>var newWindow = window.open(postAddress,opentype); false; <br> } <br><br>var postDataHtml="<html><head></head><body>" <br>postDataHtml = postDataHtml "<form id='postDataForm' method='post' action='" postAddress "'>"; <br><br>if (paramNames && paramValues && (paramNames.length == paramValues.length)) <br>{ <br>for( var i=0 ; i< paramNames.length ; i ) <br>{ <BR>postDataHtml = postDataHtml "<input type='hidden' name='" paramNames[i] "' value='" paramValues[i] "'/>"; <br>} <br>} <br><br>postDataHtml = postDataHtml "</form><script type="text/javascript"> document.getElementById("postDataForm") .submit()<script> ;<body><html>"; <br>newWindow.document.write(html); <br>return newWindow; <br>} <br><br> </div>