[Check for missing traps] highlights 01 and 01
Directory 1. jquery: Random Number generated by jsonp; browser type detection; element removal; prohibit Copying on the mobile end; select text; use of the anchor in markdown
I. jsonp generates random numbers
Use jquery's ajax method to send cross-origin requests. The request url contains a random number. The Code is as follows:
1 $.ajax({ 2 type: "GET", 3 url: url, 4 dataType: "jsonp", 5 cache:true, 6 jsonpCallback: 'callback', 7 success: function(data) {), 8 //.... 9 },10 error: function() {11 //....12 }13 });
Check the jquery manual to find that when datatype is jsonp, the default cache value is false. So passSet cache to true.
Ii. Check the browser type
1 var _ ua = navigator. userAgent. toLowerCase (); 2 window. UA = {3 weixin:/micromessenger /. test (_ ua), 4 android:/android /. test (_ ua), 5 ios:/\ biphone. * mobile | \ bipod | \ bipad | \ bmac OS x /. test (_ ua), 6 is360mse:/360 Aphone Browser | QHBrowser/I. test (_ ua) // 360 Browser (qhbrow.ios; 360 Aphone Browser Android) 7 };
3. Remove Elements
In Native JS, the methods for removing elements include removeChild and removeNode (IE only ). You cannot directly remove yourself.
Work und: Find the parent node of the element and then callRemoveChild ()Remove it.
4. Prohibit text copying and selection on the Mobile End
1 *{2 -webkit-user-select: none;3 user-select: none;4 }
5. Use of the anchor in markdown
1. A jump link is recommended.
[Description] (# jump)
2. Mark the position to jump to. markdown also supports html syntax.
<Span id = "jump"> jump here: </span>