Let's go straight to the code.//The parameters in the URL are captured and replaced with the JSON format function serilizeurl (URL) {var urlobject={}; 1. Is the regular match for? The End if (/\?/.test (URL)) {//substring intercepts the string
In the work, we need to analyze some links and analyze some information statistically. For example, the following links:Http://lightapplication.xxxx.com/?utm_source=ucweb&utm_medium=cpt&utm_term=zhilian&utm_content= Textlink&utm_campaign=novThis
If Chinese is passed in the URL, the browser will error: The header content contains invalid characters.Reason: The browser automatically decodeuricomponent this URL, English will not care, but the Chinese direct decodeuricomponent will appear
When I browse the Internet, I see some URLs of websites using the # number to pass some characters as parameters, because the content after # (well) in the URL is not added to the HTTP request, so I studied it and shared it with you.
Requires two times encodeURI () encoding and two decodeURI () decoding,When using encodeURI () encoding,var searchtype = $ ("#type_select option:selected"). Val (); // "Base News" var searchcontent = $ ("#search_val"). Val (); // "AAAA" var
Reproduced:The OpenStream () method in the URL class, which can read a resource specified by a URL object, returns a InputStream object. (1) File Protocol Introduction The file protocol is primarily used to access files on the local computer, just
JSP's summary of Chinese garbled characters in URL links, jspurl
IE by default, the parameters following the URL are not encoded and sent, but Tomat is URL encoded by ISO8859-1 by default, so there is an error.
Method 1:
Perform secondary encoding
In the work, some links need to be analyzed to analyze some information statistically. For example, the following links:Http://lightapplication.xxxx.com/?utm_source=ucweb&utm_medium=cpt&utm_term=zhilian&utm_content= Textlink&utm_campaign=novThis
To import a jar package:Import java.net.*;Convert kanji into 16 Unicode form:String xw= "News Center";String Name=urlencoder.encode (XW, "utf-8");Converts a 16-binary Unicode form string to a Chinese character:Urldecoder.decode
This article introduced the URL link in the special character escapes the method, learns the method of the escape character, has the need friend reference.Special characters in URL addresses have special uses in URLs that cannot be passed directly
ASP. NET In
URL Encoding Decoding
Today, the project needs to post data to the ASP Client URL, but the URL Chinese cannot be used. In the afternoon, ASP andAsp.netOfURL EncodingDifferent things:
Let's take a look at the following two URLs. Are
Apache mod_rewrite encounters a 404 error in URL rewriting failure caused by special symbols such as % 2F or % 5C (forward and backward slash ).
. Htaccess File
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}
Import a related jar package
(1) First of all thank http://m.blog.csdn.net/blog/u013532827/19755907 to share, I directly use the Net.sf.json.* class packet(2) packet download address: Http://download.csdn.net/detail/hedgehog8/4237121#comment inside
In general we want to have a tag click to execute JavaScript code, there are the following ways:
mode one: Click a The disadvantage of this approach is that after clicking the URL in the Address bar, add the # number, while moving the page to the
When I was doing JS code, I ran into a problem, maybe everyone has encountered.
I used the escape () function to encode, but found that he was the plus "+" filter.
At the time of decoding "+" has become empty "".
The test encodeURI () function
We know that there are many factors affecting the site, such as the quality of the content, the speed of the site, the structure of the site, the structure of the URL address and so on. Many details will have an impact on the site's future
The path to obtain the previous page address is often encountered. You can return to the previous page for use to implement this operation through JS. The following is a good example.
The path to obtain the previous page address is often encountered.
Open the server. xml file in the tomcat/conf directoryFind the following section (the tomcat version may be different)Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"Enablelookups = "false" redirectport = "8443" acceptcount =
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.