JavaScript Practical Skills Collection (2)

Source: Internet
Author: User
Skills

14. Cursor is stopped at the end of text box text

<script language= "JavaScript" >
function cc ()
{
var e = event.srcelement;
var r =e.createtextrange ();
R.movestart ("character", e.value.length);
R.collapse (TRUE);
R.select ();
}
</script>
<input type=text name=text1 value= "123" >

15. Sources of Judgement

Javascript:
Document.referrer

16. Minimize, maximize, close windows

<object id=hh1 classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Minimize" ></object>
<object id=hh2 classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Maximize" ></object>
<object id=hh3 classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Close" ></OBJECT>
<input Type=button value= Minimize onclick=hh1. Click () >
<input Type=button value= maximize ONCLICK=HH2. Click () >
<input Type=button value= closes Onclick=hh3. Click () >
This example applies to IE


17. Screen function Key Shift,alt,ctrl

<script>
function Look () {
if (Event.shiftkey)
Alert ("Do not press SHIFT key!"); You can change alt CTRL
}
Document.onkeydown=look;
</script>

18. Web pages are not cached

<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache, must-revalidate" >
<meta http-equiv= "Expires" content= "Wed Feb, 1997 08:21:57 GMT" >
or <meta http-equiv= "expires" content= "0" >

19. How do I make a form without bump and feel?

<input type=text style= "border:1 solid #000000" >
Or
<input type=text style= "Border-left:none; Border-right:none; Border-top:none; Border-bottom:

1 Solid #000000 "></textarea>

20.<div><span>&<layer> the difference?

<div> (division) is used to define a large section of the page elements, resulting in a career change
<span> to define elements within the same line, the only difference with <div> is not to create a career change
<layer> is the NS tag, IE does not support, the equivalent of <div>



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.