1. The difference between the return False,preventdefault () and the Stoppragation () in JS
Because of the default behavior of listening events and browsers, we sometimes use return False,preventdefault () or stoppropagation () in order to achieve the desired effect by blocking the default behavior of events and browsers.
Concept:
A listener event that can be monitored on a node. such as the Change event for a select node, the click event of a node.
The default behavior of the browser, which is the specific functionality of certain elements on the browser page. Click the a link to jump action, form submit action.
Stoppragation ()
Because events can be passed through nodes in the hierarchy, if there is a floating pop-up layer on the page, at the top, we want to click outside the pop-up layer to hide the pop-up layer. To achieve this effect, we generally listen to the documentelement click event, which hides the popup layer once the event is triggered.
But here is a problem, if the user in the pop-up layer click, obviously do not want to pop hide, but because of the bubbling of the event will be passed from the popup layer layer to the outermost document, then the DocumentElement Click event will be triggered, Make this pop-up layer hidden. How do we stop this bubbling behavior, then we can use Stoppragation ().
Event.stoppragation (): Prevents elements that trigger events from passing events up
Preventdefault ()
See Preventdefault () is used to block the default behavior, if there is a link on the page, click to jump to the link address of the page, if we only want to click on the trigger click event, do not want the page to jump, then you can use Preventdefault () to prevent
Event.preventdefault (): The default action to block the element that triggered the event
return false;
return false; The statement blocks the element's default action and prevents the element's up-passing (bubbling) event when the event is triggered.
Detailed Description: http://www.cnblogs.com/wang_yb/archive/2013/04/11/3014767.html
2. How to download a webpage to a local
If you look at the Web page to see a better effect, want to download the entire page, we can be on the page right mouse button , "Save as ", in the popup dialog box " Save Type " selected as " page, all " .
This is usually a Web page and a folder, open this page with what we see in the Internet is the same, but now in our local files, folders have page images, CSS files and JS files. We can do the follow-up study.
20151209 Minor issues