Quirks of different browsers summary _javascript tips

Source: Internet
Author: User
1. In the settings div top,left must be set together, otherwise the object disappears, the description layer postion set to fixed

document.getElementById ("Mydiv"). style.top=10+ "px";

document.getElementById ("Mydiv"). style.left=10+ "px";

Testing in chrome does not have this problem



2. Get the height and width of the part that the page is looking at.

IE8 can only use Document.documentelement.height/width

Chrome can use the Window.innerheight/innereidth or the top



3. Mouse pointer

IE under the custom mouse pointer plus URL can be, Cursor:url ("move.cur");

Chrome needs to be added at the back, Autocursor:url ("Move.cur"), auto;



4.javascript Address bar Dynamic output (the Address bar input javascript:void (function () {}) ()) executes a piece of code when any Web page is opened)

For example, to output a layer directly write document.write will not show anything

Only with Var obj=document.createelement ("div");

Obj.style to set

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.