Ajax Aspects: Ajax notation:
In addition, because Ajax is asynchronous flush, cannot output view, in order to view the data during the debugging process, you can write the data that need to be viewed to the file
File_put_contents ("D:/mylog.log", $data. " \ r \ n ", file_append);
JS aspect:
Back to Previous page: History.go (-1) or history.back ();
Refresh this page:
1, Location.reload (false); default = False, which means fetching data from the cache, true means getting the latest page from the server side in Get mode
2,location.replace (URL); This method replaces the item currently cached in history (client) by specifying a URL, so you cannot access the URL that has been replaced by "forward" and "back" after using the Replace method.
the difference between Jquery.min.js and Jquery.js is:min is compressed version, the removal of comments and spaces, mainly used in production environment, without min is with comments and spaces, easy to read the source code, reference one can.
Special note: Referencing two jquery libraries at the same time can cause a conflict.
Time format processing:
1. UNIX timestamp converted to date function: Date ()
General form: Date (' y-m-d h:i:s ', 1156219870);
2. Date conversion to UNIX timestamp function: Strtotime ()
General form: Strtotime (' 2010-03-24 08:15:42 ');
JSON format processing:
Eval and Json.parse
1. Use the Json.parse () method as much as possible to parse the string itself, which captures syntax errors in JSON
2. Using eval in your code is dangerous, especially if you execute third-party JSON data (which may contain malicious code)
String processing:
Chinese string interception:
Mb_substr ($str, 0,4, ' utf-8 '); Intercept the first 5 words
PHP Development FAQs