Through jquery to get URL parameters and transcoding, personally feel good, because sometimes do not transcode will have garbled problem.jquery gets the URL parameter and transcoding, first constructs a regular expression object containing the
JS get parameters, in the past I was used to split, and then get, this way feeling is the simplestMode 1:function QueryString (item) { var svalue=location.search.match (new RegExp ("[\?\&]" +item+ "= ([^\&]*) (\&?)", "I")) return svalue?svalue[
function GetURL () {var args = {};var query = location.search.substring (1); The parameter after the current link has been obtainedvar pairs = Query.split ("&");for (var i = 0; i var pos = pairs[i].indexof (' = ');if (pos = =-1) continue;var argname
JS get URL link string: location.href
It can be intercepted to obtain the transmitted parameters, which are commonly used as follows:
Location.href.indexOf ("?") ------Get it? The index value.
Note: The location.href here is not the address in
Server-side languages such as php/asp/jsp provide a function to obtain URL parameters.
But there are times when page caching is required, and server-side functionality is limited.
So using JavaScript to get URL parameters is a viable solution in
Use JS get url parameter method and PHP tutorial, ASP tutorial is not the same, if said in PHP to get a.php?id=www.111cn.net direct $_get[' a '] on Ko, but to use processing is not the same, the following look at an example.
function
Then we get the corresponding parameter values by calling this function:
To get the parameter with the same name that is in the URL string
Second, the regular analysis method. function getquerystring (name) {
var reg = new RegExp ("(^&)" + name + "=
As efficient as possible, remove the file extension from a standard URL, and then expand the code to get other data, such as: directory path, the principle is to use PHP's explode function to separate strings.For example:
After thinking about it, there will certainly be a more simple way! So I found two very simple and practical ways to do this online, mark.Method One: The regular analysis methodfunction getquerystring (name) {var reg = new RegExp ("(^|&)" + name + "=
Get full URL (protocol name + domain + site name + filename + parameter)
String fullurl = Request.Url.ToString ();
Gets the URL information requested by the client (excluding hosts and ports)
string rawurl = Request.rawurl;
Get Site name + page
Htmlparser is the module that Python uses to parse HTML. It can analyze the tags in HTML, data, etc., is a simple way to deal with HTML. Htmlparser uses an event-driven pattern that, when Htmlparser finds a particular tag, invokes a user-defined
JSP page
When using the JSTL's expression language, the request parameters are made in the available object implicit. This example demonstrates you to include the value of a request parameter from the query string or posted data in the gene Rated
The usual use scenario is when we have a page that requires a user to log in to access, we will in the code to determine whether the current access user is logged in, if not logged in, then redirect to the login page, and the current URL through the
The main solution is to rely on HttpContext objects, such as
Httpcontext.current.request.physicalpath; Gets the full physical path of the current page. For example f:xfu.nsqsprojectwebsitedefault.asp Tutorial
Recent Web site revision, found that the site's ads are direct web site, if a turn, for the site's full-time will be better
Need an HTML page to pass parameters, so use a JS to get the URL parameters of the code, just a Funciton
Reference http://img.
The code is as follows:Get the current script URLfunction Getcururl (){if (!empty ($_server["Request_uri"])){$scriptName = $_server["Request_uri"];$nowurl = $scriptName;}Else{$scriptName = $_server["Php_self"];if (Empty
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.