How can I get query string values in JavaScript?

Ads
 

How can I get query string values in JavaScript?

How can I get query string values in JavaScript?

View Answers

December 27, 2013 at 5:44 PM

To get a query string value, you can use JQuery and JavaScript.. here is the code:

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}

Ads









Related Tutorials/Questions & Answers:
How can I get query string values in JavaScript?
can i insert values into two tables by a query - JDBC
Advertisements
how i can get jqfade.js library
How can i search and insert within a query
how can i store text box values as it is in database table
Please tell me how can i convert string to timer
If Sessin Contain Array how can i get each value.
How can I get the full URL with the attached parameters? - JSP-Servlet
How Can I get ArrayList of Data from jsp with ajax request
how i can creat string array, with global visibility.
how i can creat string array, with global visibility.
how can i get output pls urget tell me
can i use big query in hibernate?
How to get a values - JSP-Servlet
How to get a values - JSP-Servlet
I cant get values in MS acces in tables
How do I change a large string into hex and then into byte so that SHA1 can be applied to it?
how to call list objects as string into my sql query?
can pass list of n values in session and get in jsp
can pass list of n values in session and get in jsp
How to get the request scope values? - Struts
How to get length of string in Java?
How To Protect Special Characters in Query String?
how to get a values from processRecord - JSP-Servlet
How can I do it? .click();
How to write javascripts - JSP-Servlet
How can I learn Java?
how to display jsp page containing mysql query in particular division using ajax ?my code is below bt i cundt get it properly
How to get the correct value by calculating double values....
how should i can solve
query string

Ads