How to Pass QueryString in window.location.href?

Abhay Andhariya

I have written the following javascript function

function getval(sel)
 {
    window.location.href = "Posts?Category=<%= sel %>";
 }

but the value of sel variable is not considered in querystring..

Instead of it, it takes value like following.

...../Post/Posts?Category=%3C%=%20sel%20%%3E

Can anyone help me???

commit

Because javascript does not understands jsp scriptlet,

Try,

window.location.href = "Posts?Category=" + sel;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to pass Id value to window.location.href in MVC application

From Dev

Pass parameter with window.location.href to MVC ActionResult

From Dev

How to pass value in window.location?

From Java

How to mock window.location.href with Jest + Vuejs?

From Dev

How to make sure code runs before window.location.href

From Dev

how to specify csv file name for downloading in window.location.href

From Dev

How to test window.location.href using jasmine

From Dev

How to use a dynamically generated id in window.location.href?

From Dev

String is not a function on window location href

From Dev

window.location.href not working

From Dev

How to pass a querystring using RegisterStartupScript?

From Dev

How can i pass multiple parameters in location.href in php?

From Dev

How to use window.location.href.replace to switch language in the href url?

From Dev

How to use Querystring with $location.path() in AngularJS

From Dev

How to use Querystring with $location.path() in AngularJS

From Dev

how do I pass parameters to onclick="window.location" in LI

From Dev

how do I pass parameters to onclick="window.location" in LI

From Dev

Enable and disable window.location.href

From Dev

onclick window.location.href with input value

From Dev

Javascript window.location.href onClick not working

From Dev

Passing parameter through "window.location.href"

From Dev

onchange event on window.location.href

From Dev

Window.location.href infinite loop

From Dev

Stubbing window.location.href with Sinon

From Dev

window.location.href not working in IE 11

From Dev

Using a variable for if window.location.href.indexOf()

From Dev

$window.location.href NOT WORKING in AngularJS

From Dev

window.location.href appending instead of replacing

From Dev

JavaScript window.location.href not working in localhost

Related Related

  1. 1

    How to pass Id value to window.location.href in MVC application

  2. 2

    Pass parameter with window.location.href to MVC ActionResult

  3. 3

    How to pass value in window.location?

  4. 4

    How to mock window.location.href with Jest + Vuejs?

  5. 5

    How to make sure code runs before window.location.href

  6. 6

    how to specify csv file name for downloading in window.location.href

  7. 7

    How to test window.location.href using jasmine

  8. 8

    How to use a dynamically generated id in window.location.href?

  9. 9

    String is not a function on window location href

  10. 10

    window.location.href not working

  11. 11

    How to pass a querystring using RegisterStartupScript?

  12. 12

    How can i pass multiple parameters in location.href in php?

  13. 13

    How to use window.location.href.replace to switch language in the href url?

  14. 14

    How to use Querystring with $location.path() in AngularJS

  15. 15

    How to use Querystring with $location.path() in AngularJS

  16. 16

    how do I pass parameters to onclick="window.location" in LI

  17. 17

    how do I pass parameters to onclick="window.location" in LI

  18. 18

    Enable and disable window.location.href

  19. 19

    onclick window.location.href with input value

  20. 20

    Javascript window.location.href onClick not working

  21. 21

    Passing parameter through "window.location.href"

  22. 22

    onchange event on window.location.href

  23. 23

    Window.location.href infinite loop

  24. 24

    Stubbing window.location.href with Sinon

  25. 25

    window.location.href not working in IE 11

  26. 26

    Using a variable for if window.location.href.indexOf()

  27. 27

    $window.location.href NOT WORKING in AngularJS

  28. 28

    window.location.href appending instead of replacing

  29. 29

    JavaScript window.location.href not working in localhost

HotTag

Archive