kullanıcı bağlantı üzerinde 'gezinen' zaman, get isteği göstermez, böylece Sergey'in kod biraz Modifiye.
Bağlantı:
<a href="#" postURL="/tpl/schRosterSearchSubmit.do?searchReci.uniqueId=&searchReci.studentId=&searchReci.schoolId=3205&searchReci.name.firstName=&searchReci.name.lastName=&searchReci.gender=&searchReci.rdobDay=&searchReci.rdobMonth=&searchReci.rdobYear=&searchReci.rssn1=&searchReci.rssn2=&searchReci.rssn3=&searchReci.phoneNumber=&searchReci.citzOrResAlien=&searchReci.country.isoCountryCode=&searchReci.address.street1=&searchReci.address.street2=&searchReci.address.city=&searchReci.address.state=&searchReci.address.zip=&searchReci.address.zipExt=&searchReci.parentN.firstName=&searchReci.parentN.lastName=&searchReci.parentEmail=&searchReci.parentMAddr.street1=&searchReci.parentMAddr.street2=&searchReci.parentMAddr.city=&searchReci.parentMAddr.state=&searchReci.parentMAddr.zip=&searchReci.parentMAddr.zipExt=&searchReci.parentPAddr.street1=&searchReci.parentPAddr.street2=&searchReci.parentPAddr.city=&searchReci.parentPAddr.state=&searchReci.parentPAddr.zip=&searchReci.parentPAddr.zipExt=&searchReci.pdobDay=&searchReci.pdobMonth=&searchReci.pdobYear=&searchReci.pssn1=&searchReci.pssn2=&searchReci.pssn3=&searchReci.parentCitzOrResAlien=&searchReci.parentCountry.isoCountryCode=&searchReci.addrUpdInd=&searchReci.inactiveDtDay=&searchReci.inactiveDtMonth=&searchReci.inactiveDtYear=&searchReci.ncoaUpdInd=&searchReci.badAddrInd=&branding=upromise&acct=XXXX&schRosterPager.offset=50" class="rnavLink">2nd Page results</a>
onclick POST dönüştürme:
<script type="text/javascript">
$(document).ready(function() {
$('.rnavLink').click(function() {
var p = $(this).attr('postURL').split('?');
var action = p[0];
var params = p[1].split('&');
var form = $('<form/>', {action:action, method:'post'}).appendTo('body');
for (var i in params) {
var tmp = params[i].split('=');
var key = tmp[0], value = tmp[1];
$('<input/>', {type:'hidden', name:key, value:value}).appendTo(form);
}
$(form).submit();
return false;
});
});
senin prooblem ne çözemiyorum .. İhtiyaçlarınız konusunda spesifik ?? –
faydalı olabilir Bu yararlı olabilir http://tomengineering.tripod.com/gettopost.html – elclanrs
"Sorun" sadece veri javascript etkinleştirilmişse POST üzerinden gönderilmesini istiyorum. Anladığım kadarıyla DOM’a giden URL’ye dayalı gizli bir form ekleyebilirim. Ama daha kolay mı yoksa daha zarif bir yolu var mı? – ottsch