日期:2014-05-16 浏览次数:20390 次
<a href="search.action?pageNow=<s:property value="#page.pageNow-1"/>&newsTitle=<s:property value="#session.title"/>">上一页</a>
function linkClick(linkObject) { var formObject = document.createElement('form'); document.body.appendChild(formObject); formObject.setAttribute('method', 'post'); var url = linkObject.href; var uri = ''; var i = url.indexOf('?'); if(i == -1) { formObject.action = url; } else { formObject.action = url.substring(0, i); } if( i >= 0 && url.length >= i + 1) { uri = url.substring(i + 1, url.length); } var sa = uri.split('&'); for(var i = 0; i < sa.length; i++) { var isa = sa[i].split('='); var inputObject = document.createElement('input'); inputObject.setAttribute('type', 'hidden'); inputObject.setAttribute('name', isa[0]); inputObject.setAttribute('value', isa[1]); formObject.appendChild(inputObject); } formObject.submit(); return false; }
<a href="search.action?pageNow=<s:property value="#page.pageNow-1"/>&newsTitle=<s:property value="#session.title"/>" onclick="return linkClick(this)">上一页</a>