Town Field Poem:The Pure Heart sentiment wisdom language, does not have the world name and the benefit. Learn water under the hundred rivers, give up arrogant slow meaning.Learn to have a small return to feed root, willing to cast a conscience blog. Sincere in this writing experience, willing to see the text to inspire.——————————————————————————————————————————Code1 DOCTYPE HTML>2 HTML>3 Head>4 Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>5 title>title>6 Scriptt
Paramsarray = Geturlparams ();if (Paramsarray!= null){for (var i = 0; i {for (Var j in Paramsarray[i]){if (j = = name){return PARAMSARRAY[I][J];}}}}return null;}
jquery plug-in notation
The code is as follows
Copy Code
(function ($) {$.geturlparam = function (name){var reg = new RegExp ("(^|)" + name + "= ([^]*) (|$)");var r = window.location.search.substr (1). Match (REG);if (r!=null) return unescape (r[2]); return null;}}) (JQuery);
We can use
background:Write a simple chat system that emits a HTPP URL to implement the jump plus a tag.
Implementation code:
Copy Code code as follows:
String.prototype.httpHtml = function () {
var reg =/(http:\/\/|https:\/\/) (\w|=|\?| \.| \/||-) +)/g;
Return This.replace (Reg, ' };
Excerpts:
Implementation of automatically adding URL addresses
The implementation of the
After the URL rewrite, the problem that is often encountered is that the postback destination address in the page is not the address that the client requested, but the address after the URL rewrite. For example, rewrite in one of the previous articles:
When the user requests "/USER/JEFFZ", the code appearing on the page is
The intent of this line of code is so obvious that it modifies the form's ac
This article mainly introduced the Nodejs realization obtains the current URL address and the URL various parameter values, this article directly gives the code example, needs the friend to be possible to refer to under
The code is as follows:
Module HTTP URL that needs to be used
Current URL http://localhost:8888/s
1.URL special characters need to be escaped2. Replace the space with a plus sign (+)3. Forward slash (/) separator directory and subdirectories4. Question mark (?) Separating URLs and queries5. Percent semicolon (%) to develop special characters6. #号指定书签7. Number Separator parameter
Reason to escape character:
If your form is submitted using the Get method, and the submitted arguments have special characters such as "", if you do not do so, you will
The code is very simple, the main idea is to parse the URL parameters to JS object, and then do add, delete, change, check the operation is very convenient ~, take notes here.
Copy Code code as follows:
var lg= (function (LG) {
var objurl=function (URL) {
this.ourl=url| | Window.location.href;
This.href= ""; the front part
This.params={};//
JS get the Routing URL address, the equivalent of PHP $_server[' Http_referer '. Methods: Using JS to obtain the routing URL address can accurately judge the true antecedents of the Web page. At present, Baidu Statistics, Google Ads statistics, CNZZ Statistics, are used this method. Anti-Theft chain is also very simple, JS to determine the routing URL if not the
//JQuery dynamically assigns a value to a tag jump new page opens. /**/Double encodeURI (encodeURI ()) is required at this time; $ (' #test '). On (' click ',function(){ varBatch =$ (' #zhongwen '). Val ();//Get Chinese value varUrl= encodeURI ("index.php?many_type=2batch=" +batch); $("#test"). attr (' href ',encodeURI (URL))});//when decoding, useBatch= decodeURI (Geturlparam (' batch '));//get the parameters inside the URLfunctionGeturlparam (
Reprinted from: http://blog.csdn.net/langeldep/article/details/6264058The code for this article has been modified from PHP code, leaving only 2 functions.int Php_url_decode (char *str, int len);Char *php_url_encode (char const *s, int len, int *new_length);URL encoding does the following:Character "a"-"Z" , "A"-"Z" , "0"-"9" "." , "-" , "*" "_" are not coded to maintain the original value; The space "" is converted to the plus sign "+". Eac
In the WordPress background editing the article, paste the URL directly into the article content, WordPress can not automatically generate hyperlinks (clickable links), if we have to "insert or edit Links" This button to insert the link, the operation is a bit troublesome. People should not know WordPress provides a function called Make_clickable, which automatically converts URLs to clickable hyperlinks.The use of the method is simple, by the_content
The URL (URL) you requested could not be obtained, but the server repeatedly received two commits
After the form submits the data, execute the PHP code (constantly insert records into the database, such as 1000 records).
But sometimes it turns out that the data record is 2000, half the number.
Then I wrote the log at the end of the execution, found that there are often two logs, separated by about 100 seco
Append the isapirewrite4.dll provided above
Now we have configured isapirewrite4.ini. Note that isapirewrite4.ini and isapirewrite4.dll must be in the same directory.
######################################## ######
# Isapirewrite4.ini## INI file for the ISAPI rewriter.## An example for doing translation of JSP to Aspx. This is useful# When doing a staged migration of a website, moving from JSP# ASP. NET. Similar approach cocould work with ASP, PHP or other# Server-side scripting languages age
Yii obtains the current url and domain name, And yii current urlSuppose the access address of our current page is: http: // localhost/CMS/public/index. php? R = news id = 1I,1,Obtain the current domain name: echoYii: app ()-> request-> hostInfo;Result: http: // localhost2,Get (except the domain name) The current URL: echoYii: app ()-> request-> getUrl ();Result:/CMS/public/index. php? R = news id = 13,Obt
1. Add the encoding method of the entire website to the web. config file. In this way, the parameters are transmitted in gb2312 Chinese encoding mode. The default value is UTF-8.2. the parameter is first encoded during transmission, first encoded when accepted, and then received. String mm = Server. URLEncode (you );Response. Redirect (index. aspx? Mm = + mm );Then decode on the receiving page:String mm = Server. URLDecode (Requext. querystring (mm ));There are several methods in javascript to e
The requirement of the previous article is much simpler.[STEP]① Create a test directory in the project, and then create a page under the test directory: ax. aspx② Add the application_beginrequest () method to global. asax. CS.
Protected
Void
Application_beginrequest (Object sender, eventargs E)
{ String Originalurl, newurl;Originalurl = Request. url. pathandquery; // Get the Page name, excluding the extension Newurl = Origina
Additional parameters to get introduced:Sets or gets the file name or path specified by the object.alert (window.location.pathname);Sets or gets the entire URL as a string.alert (WINDOW.LOCATION.HREF);Sets or gets the port number associated with the URL.alert (Window.location.port);Sets or gets the protocol portion of the URL.alert (Window.location.protocol);Sets or gets the segment behind the pound sign "#" in the href attribute.alert (Window.locat
The preface and the Middle passage are all the processes and ways of thinking that I have found the problem. Not interested can skip to see the problem and solve later.
Objective:
The problem occurs when the site is completed and deployed to the server. Thought it was the easiest job. The result was a tragedy. The IIS7 is used on Windows Server 2008 R2. URL redirection with no suffix is not recognized. A lot of people will say that the problem is ve
If you get the "current" domain name host = Window.location.host;
Url=document.domain;
url = window.location.href;
Get full URL path: The following code can be used to fully document the results:
Run as follows:Thisurl:["+ Thisurl +"] "Strwrite + +"Thishref:["+ Thishref +"] "Strwrite + +"Thissloc:["+ Thissloc +"] "Strwrite + +"Thisdloc:["+ Thisdloc +"] "document
Although the URL can be dynamically modified by submitting the post form in a get way, but if more than one button can be submitted in parallel, write a number of roughly the same, and some details of the difference between the form, it is inevitable that some improper, so think of the dynamic through JS to modify the URL, to achieve the URL additions and deletio
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.