A JavaScript statement is used to obtain the URLs of all images on the current webpage.

Source: Internet
Author: User

In the address bar, enter:

Javascript: Str = ''; for % 20 (var1 = 0; var1 <document. images. length; var1 ++) {STR + = '/N' + document. images [var1]. SRC}; If (STR! = '') {Document. Write (STR); void (document. Close ()} else {alert ('no % 20 images! ')}

View the source code of the new page.

To display the information:

Javascript: funcname = ''; for % 20 (var1 = 0; var1 <document. images. length; var1 ++) {funcname + = '/N' +' <br>'}; If (funcname! = '') {Document. write ('<center>' + funcname + '</center>'); void (document. close ()} else {alert ('no % 20 images! ')}

Show and add Link

Javascript: funcname = ''; for % 20 (var1 = 0; var1 <document. images. length; var1 ++) {funcname + = '/N' +' <a % 20 href = '+ document. images [var1]. SRC + '> </a> <br>'}; If (funcname! = '') {Document. write ('<center>' + funcname + '</center>'); void (document. close ()} else {alert ('no % 20 images! ')}

Common forbidden right-click code

<Script language = "JavaScript">
Function click (){
If (event. Button = 1) {// change to button = 2 it is best to add a right-click if it is not allowed | button = 3 prevent being cracked, for example, code 3
Alert ('Sorry, this function is forbidden .')
}
}
Document. onmousedown = click
</SCRIPT>

Code 2
<SCRIPT>
Document. oncontextmenu = new function ("Return false ;")
</SCRIPT>

Code 3
<Script language = "JavaScript">
Function click (e ){
If (document. All ){
If (event. Button = 2 | event. Button = 3 ){
Oncontextmenu = 'Return false ';
}
}
If (document. layers) {// under NNS
If (E. Which = 3 ){
Oncontextmenu = 'Return false ';
}
}
}
If (document. layers ){
Document. captureevents (event. mousedown );
}
Document. onmousedown = click;
Document. oncontextmenu = new function ("Return false ;")
</SCRIPT>

Code 4
<Body oncontextmenu = "Return false" ondragstart = "Return false"
Onselectstart = "Return false" onselect = "document. selection. Empty ()"
Oncopy = "document. selection. Empty ()" onbeforecopy = "Return false"
Onmouseup = "document. selection. Empty ()">

 

Original article link: http://hi.baidu.com/sunsee/blog/item/9ef5774eff1d0c0bb3de058d.html

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.