I am making an option select function that takes the add a unique dynamic url and replaces the
&
with
&
in the URL.
Jquery
$("#pageSizeOptions").change(function () {
document.location.href = ('?ViewAction=View&ObjectID=1710211').replace(/(\?|&)(PageSize=[^&]+)(&|$)/, '$3') + $(this).val();
});
Perl Template (jquery)
$("#pageSizeOptions").change(function () {
document.location.href = ('#Pager.URL').replace(/(\?|&)(PageSize=[^&]+)(&|$)/, '$3') + $(this).val();
});
OUTCOME:
http://fiddle.jshell.net/RFfXs/5/show/light/?ViewAction=View&ObjectID=1710211&PageSize=40
EXPECTED OUTCOME:
http://fiddle.jshell.net/RFfXs/5/show/light/?ViewAction=View&ObjectID=1710211&PageSize=40
http://jsfiddle.net/RFfXs/5/
Can anyone help on what exactly i am doing wrong..
.replace(/&/g, '&')
http://jsfiddle.net/cP5Qs/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With