Using jquery to get URLs and using jquery to get URL parameters is the operation we often use, the following text description and code analysis of the form for everyone to analyze, please see below for details.
1, jquery get URL is very simple, the
The following are several methods that have been used by the home of scripts.Copy codeThe Code is as follows: Below are the regular functionsUse Javascript regular expressions to parse url linksHttp://www.jb51.net/article/15000.htmThe following code
[story caused by failure] Processing with a plus sign in the URLSource: http://agapple.iteye.com/blog/773061
HTML javaScript HTTP protocol
Cause of the problem:URL parameters, because this way the arguments are visible
The difference between get and post:There are 5 differences between get and post methods in form submission.1.get is the data that is fetched from the server, and post is the data sent to the server.2.get is to add the parameter data queue to the
JavaScript gets the URL parameter code instance:Sometimes you might need to get the parameter values in the URL, and here's a related code instance.The code is as follows:varUrl= "Www.softwhy.com/test.php?id=21&a=5"; if(Url.indexof ("?")! =-1){
Here are some of the ways that the cloud-dwelling community has been using
Copy Code code as follows:
Here is the regular function
Parsing classes that implement URL links with JavaScript
Http://www.jb51.net/article/15000.htm
Window.location method can also take parameters such as Href,search, let us look at the URL to get the parameters of the method.URL: Uniform Resource Locator (Uniform Resource Locator, URL)The complete URL consists of the following
I have seen several interview questions recently, one of which is about writing a method to get the field contents of the URL query section of the browser address bar. Although I have seen the related things before, but feel a little vague, so it
JavaScript from the URL string to get the parameter value, in the Ajax prevalence today, it is particularly important, because most of the Ajax is the need to pass the value, so as to better realize user interaction, then use JS to get URL string
Instance 1
The code is as follows
Copy Code
function getquerystring (name) {var reg = new RegExp ("(^|&)" + name + "= ([^&]*) (&|$)");var r = window.location.search.substr (1). Match (REG);if (R!= null)Return unescape (r[
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.