Change URL parameters

前端 未结 26 2599
孤独总比滥情好
孤独总比滥情好 2020-11-22 08:40

I have this URL:

site.fwx?position=1&archiveid=5000&columns=5&rows=20&sorting=ModifiedTimeAsc

what I need is to be able to

26条回答
  •  猫巷女王i
    2020-11-22 09:15

    Would a viable alternative to String manipulation be to set up an html form and just modify the value of the rows element?

    So, with html that is something like

    With the following JavaScript to submit the form

    var myForm = document.getElementById('myForm');
    myForm.rows.value = yourNewValue;
    myForm.submit();
    

    Probably not suitable for all situations, but might be nicer than parsing the URL string.

提交回复
热议问题