My code is like this.
In JQ
$ (' #add_user '). Ajaxsubmit ({
url:thinkphp[' MODULE ']+ '/user/add ',
Type: ' POST ',
Success:function (data) {
alert (data);
var top= (screen.height-500)/2;
var left= (screen.width-500)/2;
window.open
In jsp, post requests are generally not garbled. If the request is garbled, add the following sentence:Solution 1 The code is as follows:Copy code Request. setCharacterEncoding ("UTF-8 "); For get requests, if the url contains non-Western
This article is from: script House (Www.jb51.net) For details, refer:Http://www.jb51.net/article/13242.htm----------------------------------------------------------
Method One: The regular analysis methodfunction getquerystring (name) { varnew RegExp ("(^|&)" + name + "= ([^&]*) (&|$)", "I" ); var r = window.location.search.substr (1). Match (reg); if NULL return return NULL ;}This is called:Alert
URL is: Uniform Resource Locator (uniform Resource Locator, URL)The complete URL is composed of these parts:Scheme://host:port/path?query#fragmentScheme: Communication protocolCommonly used Http,ftp,maito, etc.
Http://localhost/test/test.htm?id=1
Example url:http://www.111cn.net/test/test.php
The code is as follows
Copy Code
$_server[' server_name ']: www.111cn.net$_server[' Server_port ': 80$_server[' Request_uri ']:/test/test.php
Then we can combine
Example
The code is as follows
Copy Code
Add an IE Firefox compatible
Character Read
The code is as follows
Copy Code
Example Two
The code is as follows
Parse_url function
Let's take a look at the Parse_url function, the official solution
Description
Mixed Parse_url (string $url [, int $component =-1])
This function resolves a URL and returns an associative array containing the various
In asp.net, if you use a URL rewrite, you get the rewritten address via httpcontext.request. If this address is to be returned to the client (such as redirect), we generally wish to be the friendly address before the rewrite.
The usual use
method One: Simple, no parameters, only one virtual path
Copy Code code as follows:
GetUrl =request ("url")
For example: HTTP://127.0.0.1/SHIYAN.ASP?DFSDFSF=DSFSDFDAA=DDDD
Get as: shiyan.asp
Copy Code code as follows:
This article summarizes the analysis. NET gets the method of solving the garbled problem of the URL Chinese parameter value. Share to everyone for your reference, specific as follows:
Workaround:
1. Set up Web.config file
2.
In Data acquisition and page analysis, often need to crawl the content of a given URL page, or the second, third level depth page content.
Here is a test example implementation, for reference only.
The code is as follows:
/*Match a given page
In web development, many developers prefer to use JavaScript to get the current URL URLs, this article for you to summarize the more commonly used to get the URL of the JavaScript implementation code
The URL is the Uniform Resource Locator (uniform
function code
Copy Code code as follows:
function parseURL (URL) {
var a = document.createelement (' a ');
A.href = URL;
return {
Source:url,
Protocol:a.protocol.replace (': ', '),
Host:a.hostname,
Port:a.port,
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.