• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Quick Copy And Paste Scripts

Admin

Well-Known Member
Staff member
Administrator
Quick Copy and Paste Scripts.
These javascript snippets can be cut and pasted into your page with little or no alteration. To copy the scripts highlight them with your mouse and then press the [Ctrl] & [C] keys simultaneously to copy them to the clipboard. The script can then be pasted into your application. You are encouraged to play with the variables in these scripts to learn more about how they work.



--------------------------------------------------------------------------------

Microsoft Smart Tags
Windows XP and IE6+ technology allows Microsoft to insert links in your Web Pages without your knowledge or permission. Luckily this function can be disabled by pasting the following tag into the head of your document.

Code:
<META NAME="MSSmartTagsPreventParsing" content="true">



--------------------------------------------------------------------------------

Automatic Print Script
This is a super-easy little script that you can use to form an automatic print-page link on your site. Just insert this script where you want the link to display and your visitors can choose to print the page they are viewing.

Code:
<a href='javascript:;' onClick='window.print();return false'>Print this page.</a>




--------------------------------------------------------------------------------

No Right Click
Place this script between the head tags. You can change the wording in Red. Just be aware that these "no right click" type scripts only deter the inexperienced user. There are many ways around them.

Code:
<script LANGUAGE="JavaScript">
<!--
function click() {
if (event.button==2) {
alert('[color=red]Right Click Option Not Available![/color]');
}
}
document.onmousedown=click
// -->
</script>



--------------------------------------------------------------------------------

Bookmark Page
Paste this snippet in the body of your document where you want the link to appear. Change the script in Red.

Code:
<!--[if IE]>
<a href="javascript:window.external.AddFavorite('http://www.yoursite.com/', 'My Site Title');">Bookmark This Site!</a>
<![endif]-->

This script only works for IE5+ browsers. Other browsers will not see anything.



--------------------------------------------------------------------------------

Make Your Page Users Start Page
This script will let users make your page the start up page for their browser. Paste this snippet in the body of your document where you want the link to appear.

Code:
<!--[if IE]>
<a HREF style="cursor:hand;" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.mysite.com');">Make this page your home page!</a>
<![endif]-->


This script only works for IE5+ browsers. Other browsers will not see anything. Just change the http://www.mysite.com to the URL of your page.



--------------------------------------------------------------------------------

No Frills Popup
Just copy and paste this into the head of your document changing the script in Red.

Code:
<SCRIPT language="JavaScript">
<!--
window.open('mypage.html');
// -->
</SCRIPT>




--------------------------------------------------------------------------------

Close Window With A Button
Add this short snippet to the body of your popup windows so that they can be closed easily.

Code:
<form>
<input type="button" value="Close Window" onClick="window.close()">
</form>

(See "Jazzing Up Your Forms" at the bottom of this page for ideas to make your button look more stylish.)



--------------------------------------------------------------------------------
Close Window With A Link
Add this short snippet to the body of your popup windows so that they can be closed easily.

Code:
<a href="javascript: self.close()">Close Window</a>



--------------------------------------------------------------------------------

Updating Copyright Notice
This copyright notice places the current year on the page so that copyright notices are always current. Once it's on your page there is no need to update the script.

Code:
<script language = 'JavaScript'>
<!--
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
var today = new Date();
var year = y2k(today.getYear());
document.write('© '+year+' all rights reserved');
//-->
</script>

Example: © 2013 all rights reserved



--------------------------------------------------------------------------------

Date Last Modified.
Use this script to show when your page was last modified.

Code:
<script language="javascript">
<!--
document.write('Last modified '+document.lastModified);
//-->
</script>

Example: Last modified 01/06/2013 14:29:38



--------------------------------------------------------------------------------

Back to Top of Page link
Use this script if you have a long page.

Code:
<a href="javascript:window.scrollTo(0,0);">Back to top of page</a>

Example: Back to top of page



--------------------------------------------------------------------------------

Add the current date to your page.
This script will add the date in the form dd month yyyy (eg. 7 January 2000). Just copy and paste it into the document where you want it to appear.

Code:
<script language="JavaScript">
<!--
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
var months = new makeArray('January','February','March','April','May','June', 'July','August','September','October','November','December');
var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
document.write(day + " " + months[month] + " " + year);
//-->
</script>


Example: 6 January 2013



--------------------------------------------------------------------------------

Document Last Modified (a more readable version)
Insert this code in your document where you want the page last modified date to appear.

Code:
<script language = 'JavaScript'>
<!--
function makeArray0() {
for (i = 0; i<makeArray0.arguments.length; i++)
this[i] = makeArray0.arguments[i];
}
var days = new makeArray0("Sunday","Monday","Tuesday","Wednesday","Thursday" ,"Friday","Saturday");
var months = new makeArray0('January','February','March','April','May','June', 'July','August','September','October','November','December');
function nths(day) {
if (day == 1 || day == 21 || day == 31) return 'st';
if (day == 2 || day == 22) return 'nd';
if (day == 3 || day == 23) return 'rd';
return 'th';
}
function getCorrectedYear(year) {
year = year - 0;
if (year < 70) return (2000 + year);
if (year < 1900) return (1900 + year);
return year;
}
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
function padout(number) { return (number < 10) ? '0' + number : number; }
var last = document.lastModified;
var date = new Date(last);
var dateY2K = new Date(getCorrectedYear(date.getYear()),date.getMonth(),date.getDate());
document.write('Last Modified: '+ days[dateY2K.getDay()] + ' ' +
dateY2K.getDate() + nths(dateY2K.getDate()) + " " +
months[dateY2K.getMonth()] + ", " +
(y2k(dateY2K.getYear()))
);
//-->
</script>


Example: Last Modified: Sunday 6th January, 2013



--------------------------------------------------------------------------------
Break Out Of Frames
Use this script in between the <head></head> tags of your document to automatically bust out of other peoples frames.

Code:
<script language="JavaScript">
<!--
if (window != top) top.location.href = location.href;
//-->
</script>

Of course if your own site is a framed site then this could cause an endless loop and your pages will not be viewable.



--------------------------------------------------------------------------------

Highlight the Background of Text

Code:
<span style="background-color:ff0000;">Put Your Text Here</span>

Change the color of the text as well.

Code:
<span style="background-color:ff0000; color: 0000ff">Put Your Text Here</span>


You could even highlight the background of a whole paragraph using...
Code:
<div style="background-color: CDFFB2"> Your Text Goes Here </div>

The possibilities are almost endless.

--------------------------------------------------------------------------------

Add a Title Attribute to Text Links
This will popup a small description like that used in "alt" for your graphics.

Code:
<A HREF="http://daivietpda.vn" TITLE="Great Website Tools!">Your Text Here</a>

Add an internet search box to your site.
Your visitors will be able to search the WWW (via multiple search engines) and a KIDSAFE search engine (Yahooligans). Just copy and paste the following script into your document and you will have your visitors returning to your site every time they are looking for something on the WWW.
The Super Search Box will appear on your page just as the working copy does at the bottom of this page.


Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Super Search Box © 2013 RACKHOST.INFO
document.writeln('<TABLE CELLPADDING=\"0\" CELLSPACING=\"2\" width=\"230\" border=\"2\" bordercolor=\"#000000\" bgcolor=\"#ffffff\">');
document.writeln('<TR><TD width=\"100%\">');
document.writeln('<form method=\"GET\" action=\"http://s1.search66.com/cgi-bin/search.cgi\" target=\"_blank\">');
document.writeln('<DIV ALIGN=\"center\">');
document.writeln('<font size=\"-1\"><b>Internet search</b></font><BR> ');
document.writeln('<input type=\"text\" name=\"q\" size=\"32\"> <br>');
document.writeln('<input type=\"hidden\" name=\"c\" value=\"w\">');
document.writeln('<input type=\"hidden\" name=\"uf\" value=\"ON\">');
document.writeln('<input type=\"hidden\" name=\"st\" value=\"phrase\">');
document.writeln('<input type=\"hidden\" name=\"ss\" value=\"3\">');
document.writeln('<input type=\"submit\" value=\"Search\"> <INPUT TYPE=\"reset\" VALUE=\"Reset\"></div>');
document.writeln('</form>');
document.writeln('</TD></TR>');
document.writeln('<TR><TD valign=\"top\">');
document.writeln('<div align=\"center\">');
document.writeln('<FORM METHOD=GET action=\"http://search.yahooligans.com/search/ligans\" target=\"_blank\">');
document.writeln('<font size=\"-1\"><B>Kid safe search</B></font><BR>');
document.writeln('<INPUT type=\"text"\ size=\"32\" name=\"p\"><br>');
document.writeln('<INPUT type=\"submit\" value=\"Search\"> <INPUT TYPE=\"reset\" VALUE=\"Reset\"></form></div>');
document.writeln('</TD></TR>');
document.writeln('</table>');
//-->
</SCRIPT>
Page Formatting Note: The Super Search Box script generates a table that is 230 pixels wide. If you cannot fit it in a table cell on your existing page you may need to paste the code at the bottom of your page or, alternatively, on it's own page.

Due to the style sheets used in your site, search box may have a slightly different look.

Place this script in the head of any document that you want to be maximised.

Code:
<script language="Javascript">
<!--
window.moveTo(0,0)
window.resizeTo(screen.width,screen.height)
//-->
</script>



--------------------------------------------------------------------------------

Keep Window In Focus
Use this code to make sure a window remains in focus, on top. Great for web site news or smaller popup windows that are easily shuffled under out of focus.

Code:
<body onblur="self.focus();">



--------------------------------------------------------------------------------
Allow Users To Save Your Page To Their Hard Drive
IE4+ browsers have a function that allows you to call the SaveAs dialog to save a web page. The following script includes an alternate alert message for non-IE browsers.

Paste the following script in the head of of your document.

Code:
<script language="JavaScript">
<!--
var isReady = false;
function doSaveAs(){
if (document.execCommand){
if (isReady){document.execCommand("SaveAs");}
}else{
alert('Feature available only in Internet Exlorer 4.0 and later.');
}
}
//-->
</script>

Include the following onload event call in the body tag. This stops the page being saved until it is fully loaded.

Code:
<body onload="isReady=true">

To call the script from the page and activate the SaveAs dialog, insert a link in the page like this:

Code:
<a href="javascript:doSaveAs()"> Click Here To Save This Page </a>



--------------------------------------------------------------------------------

Show users where on your site they currently located.

Example: You are here: > C: > Users > DELL > AppData > Local > Temp > e > 88786-030911-065434-00.a2k > quick.html

The results you get from a page on your hard drive will obviously be different to those from your web site.

Insert the following code in the body of each document where you want the information to appear. No code changes are necessary.

Code:
<script language="JavaScript">
<!--
thePath = '';
loc = '' +location.href;
paths = loc.substring(7).split('/');
for (i=0, n=paths.length;i<n;i++)
thePath += '> ' + paths[i] + ' ';
document.write('<font color="#ff0000"><b>You are here: ' +
thePath.substring(1)+'</b></font>');
//-->
</script>



--------------------------------------------------------------------------------

Default Statusbar Message.

Code:
<BODY OnLoad="window.defaultStatus='Put Your Message Here!';">



--------------------------------------------------------------------------------
to be continued.............




Source & read more http://master-land.net/t/37060/quick-copy-and-paste-scripts.html
 

Facebook Comments

Similar threads
Thread starter Title Forum Replies Date
Admin Quick Theme Switcher xenforo 2 Xenforo 0
Admin [OzzModz] Quick Reply Button For Threads Xenforo 0
N Quick review SSD Patriot Blast 120GB: hiệu năng vượt trên tầm giá Tin tức CNTT 0
Admin Images as quick links to forums vbb 4.2.1 Vbb tutorial 0
V Bring Back "Go" Button for VB4 by BOP5 (ForumJump/Quick Navigation menu) Vbulletin 0
Admin Chương trình đọc file PDF. Quick office Adobe Reader cho s60v3 S60 0
Admin Move smilies to below text area (and optionally add to Quick Reply) Add-ons 0
Admin Quick Account Switch for vBB 4 - Cho phép thành viên dùng nhiều tài khoản như Google Add-ons 0
K Help Xoá Chữ forum quick links Style vbb 2
Admin Share vinanghinguyen quick mod manager tools- Công cụ quản lý nhanh dành cho mod Add-ons 2
Admin MARCO1 Advanced Quick Reply v.4.5 - Advanced Quick Edit - With Smiles!! Add-ons 0
congtust24 Unlock code miễn phí từ quick office cho symbian S60 0
Admin Share mod AMP Quick Auto Tagger for vbb4.1.x Add-ons 0
Admin Mod quick reply for guests cho vbb4.x.x Add-ons 0
Admin Share mod quick auto resize-imager ( thu nhỏ hình ảnh ) cho vbb Add-ons 0
Admin [PB] Copy Link to Thread Xenforo 0
Admin [Xen-Soluce] Copy Categories - XFRM xenforo 2 Xenforo 2.x Premium 0
T NAS siêu khủng Synology RS18016xs+ (hơn 1PB), copy 3GB chỉ mất 1 giây Tin tức CNTT 3
Lee_Jin Hướng dẫn Cách mod copy tự do max 99999 kí tự cho UC Browser J2ME 3
C Chống copy bài Phpbb3x 0
P Share Code auto chèn bản quyền khi copy bài viết Javascript/ajax 0
W Share Code chống copy trang wap HTML & CSS 2
Admin UC 8.9 mod auto click, fix lag, mod copy max text, load và down cực nhanh Crack, hack, mod, ghép game, ứng dụng 0
Admin Download Copy Protect 1.5.0 Full - Chống Sao Chép Bất Hợp Pháp Phần mềm 0
H Xin Opera 7 Mod Copy Và Dán Kí Tự Lớn Cho S40 S40 8
Cuongkoj00 [SIÊU HOT]UC Browser Multi Clipboards-copy Không Giới Hạn S40 8
Admin [Mod-Mall] Tynt - Add link to copy/pasted content (for SEO) Add-ons 0
Kayashiteru Xin File copy.php để leech code về host Vbulletin 7
Admin Share cách tạo màu select khi copy hay xem bài viết Vbulletin 0
A Help xin anh em copy css web này giúp Thảo luận wap việt 2
N Ongame Mini 188 Demo Háck Phỏm V2 By Emga9xkc Edit copy right nhokohyear Trò chơi 16
style Thảo luận Học Copy CSS Wap builder, wapego, xtgem, wen.ru, wapka, wap4 0
Admin Phần mềm PC Miễn phí bản quyền phần mềm sao chép đĩa DVD WinX DVD Copy Pro 3.4.5 Phần mềm 0
F Hỏi Help cách copy doan văn bản trong ucweb Phần mềm 2
Admin Hướng dẫn tự đặt link web khi copy đi web khác Vbulletin 4
Admin Encode IMG URL - Chống copy hình trong bài viết cho vbb all version Add-ons 0
Admin Làm sao để copy hình, chữ từ web khác vẫn giữ nguyên bản gốc cho vbb Vbulletin 4
Admin Javascript chống view chống copy JavaScript / Ajax 0

Similar threads

New posts New threads New resources

Back
Top