redirect user to current page with some querystring using javascript

后端 未结 10 2054
無奈伤痛
無奈伤痛 2021-01-01 12:09

When a person clicks on a link, I want to do this:

  1. grab the text from a textbox
  2. encode the text
  3. redirect to currentpage.aspx?search=textboxva
10条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-01 12:50

    window.location.href = window.location.href + "?search=" + escape( $("#someId").val()); ?

提交回复
热议问题