# Test URL: http: // localhost/blog/testurl. php? Id = 5Copy codeThe Code is as follows:// Obtain the domain name or host addressEcho $ _ SERVER ['HTTP _ host']. ""; # localhost// Obtain the webpage addressEcho $ _ SERVER ['php _ SELF ']. ""; #/blog/
When json is used to transmit data in ajax, other data types are not a problem. However, if the JSON generated by the server contains bool data, a small problem occurs during client parsing, summary:The JSON returned by the server is:Copy codeThe
1. Obtain subnodes For example, if it is a div element whose id is test, we select $ ('# test') and we want to find a span element whose class is demo under this div, there are several methods1. Use filtering Conditions$ ('# Test span. demo ')2. Use
Example 1:Copy codeThe Code is as follows: 10 minutes and 00 seconds
Example 2
Countdown jump page
Copy codeThe Code is as follows: JS countdown webpage automatic jump Code 3 seconds later, the system automatically jumps, click the link below
Find information on the Internet to learn about performance optimization. The content is now easy to organize and can be used only for your reference during the optimization process. If you have any questions, please submit them in time, then make
(⊙ O ⊙ )!!! This is too Nima official SA. As a cainiao, I cannot understand what it meant to express! But as a curious cainiao, I really want to know what "closure" is! So I finally found the legendary "du Niang" for help! A little bit of
Mobile phone number verification
Reference content is as follows:Copy codeThe Code is as follows:JQuery. validator. addMethod ("mobile", function (value, element ){Var length = value. length;Var mobile =/^ (13 [0-9] {1}) | (15 [0-9] {1}) + \ d {8}) $
There are three ways to bind events in Jquery: Taking the click event as an Example(1) target. click (function (){});(2) target. bind ("click", function (){});(3) target. live ("click", function (){});The first method is easy to understand. In fact,
Hiding modal Windows is a good solution for processing interface elements that are not special and necessary to appear on webpages. Social networks can use modal windows to send private messages and forms that are only visible to members. The blog
Share a bubble prompt box. The exercises are as follows: (1) JS responds to mouse events; (2) making triangles with pure CSS.The effect is as follows: Here is html:Copy codeThe Code is as follows: bubble dialog box bubble dialog box
Element. clientWidth // The actual width of the element, not a borderElement. clientHeight // The actual height of the element, not the borderElement. offsetWidth // The actual width of the element and the borderElement. offsetHeight // The actual
"Window. location. href" and "location. href" indicate the current page Jump."Parent. location. href" is the previous page Jump"Top. location. href" is the outermost page JumpExample:If A, B, C, and D are all jsp, D is the iframe of C, C is the
The following is the gradient js Code (indicating that the remaining three lines need to be hidden, click "more" to show the remaining lines, and click "less" to gradually hide them ):Copy codeThe Code is as follows:Function
Using jquery technology to operate a table is simple. Using jquery syntax, you can easily change the color of a table by row, and hover the highlighted content, in actual applications, check boxes may appear in the table. When deleting a table,
Copy codeThe Code is as follows:$ ("# Focus. input_txt"). each (function (){Var thisVal = $ (this). val ();// Determine whether the value of the text box is null. If there is a value, the prompt is hidden and displayed if there is no value.If
Sometimes we want to write a small program with js, but feel it is quite troublesome to run it with a browser. Now let's take a look at how to use java programs to call javascript programs, in this way, JavaScript code can be executed without using
After testing, it is found that alert will interrupt the timer function of settimeout. After the dialog box is closed, the time of settimeout starts to start timing again, instead of breaking from it.For example, if settimeout is set to 5 minutes
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service