Home >Web Front-end >H5 Tutorial >Share some unpopular knowledge about html5
HTML is the unified language of the Web. These rough tags contained in angle brackets constitute today's Web. In 1991, Tim Berners-Lee wrote a document called "HTML Tags", which includes about 20 HTML tags used to mark web pages. He directly borrowed the markup style of SGML, which is the HTML markup style we saw later.
Today, the editor of Huwu will sort out the html5 cold knowledge that you may not know.
Run the browser address barJavaScriptCode
Many people should still know this. You can run JavaScript code directly in the browser address bar. The method is to start with javascript: followed by execution statement. For example:
Chr Ome will automatically remove the javascript: at the beginning of the code, so it needs to be added manually for correct execution. Although Firefox will not automatically remove it, it does not support running JS code in the address bar at all! !
Run HTML code in the browser address barIf more people know the little secret above, fewer people know this tip. In non-IE core browsers The address bar can run HTML code directly!
Editor Still making a fuss on the browser address bar, paste the following code into the address bar and run it, and the browser will become a primitive and simple editor, just like the notepad that comes with Windows, roar Roar.
attribute, when the element is specified with this attribute, the content of the element becomes editablestate.
By extension, after putting the following code into the console and executing it, the entire page will become editable!
##Use a tag to automatically parse URL
query
keywords,variablesparameter values, etc., but we never expected that the browser can easily help We accomplish this task without writing regular code to capture it. The method is to first create an a tag in the JS code and then assign the URL that needs to be parsed to the href attribute of a, and then we get everything we want.
As shown below:
Use the above method to Browser parameters to operate!
Elements with IDs on the page will create global variables
In an HTML page, all elements with ID attributes set will create corresponding global variables in the JavaScript execution environment, which means document.getElementById is as redundant as the human appendix. But in actual projects, it’s best to just write it honestly. After all, the chance of things going wrong with regular code is much smaller.
As shown below:
When loading the CDN file, You can omit the HTTP identifier
Nowadays, the popular CDN loads some common JS and CSS files from a dedicated server. For security considerations, some CDN servers use HTTPS to connect, while others use traditional HTTP, in fact, we can ignore this when using it and omit it from the URL.
Use the script tag to save any information
Set the script tag to type='text' and then you can save any information in it, and then you can Easily available in JavaScript code.
Of course, there are far more trivia than these.
【Related recommendations】
1. Free h5 online video tutorial
3. php.cn original html5 video tutorial
The above is the detailed content of Share some unpopular knowledge about html5. For more information, please follow other related articles on the PHP Chinese website!