ManyCodes.com – codes & scripts Get free programming codes and tutorials!

29Jul/091

How to allow your visitor to bookmark your website

Here is how you can allow your visitor to bookmark your website.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
<!-- START OF Add Bookmark in IE DHTML -->

<!-- SUMMARY BRIEF

 This code will allow you to put a link on your
 page that, when clicked, will add a URL to the
 user's Favorites.

 NOTE: This will only work for IE users. It will
 NOT work for users using Netscape.

 You can change the bookmark link and text in the
 var bookmarkurl and var bookmarktitle attributes
 below.

 You can change the text of the actual link in the
 <A HREF> code that you will place for your link
 to appear in your page. It is located at the
 bottom of this page.

-->

<!-- Put this code inside of your <HEAD> tag. -->

<script language="JavaScript1.2">
<!--

var bookmarkurl="http://www.javaScriptfreecode.com/"
var bookmarktitle="-=[ Java Web Site ]=-"

function ccaddbookmark() {
 if (document.all)
 window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

//-->
</script>

<!-- Put this code into your page wherever you want the link to be. -->

<a href="javascript:ccaddbookmark()" target="_self">
<font size="1" face="Arial">[ Add Webloger to your Favorites ]</font>
</a>
<font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/">
<span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
29Jul/090

How to redirect to another webpage when a visitor visits your website

Here is how you can redirect to another webpage when a visitor visits your website.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
<p><!--webbot bot="HTMLMarkup" startspan --><form name="redirect">
<center>
<font face="Arial"><b>You will be redirected to the script in<br><br>
<form>
<input type="text" size="3" name="redirect2">
</form>
seconds</b></font>
</center>

<script>
<!--

var targetURL="http://www.javakhafan.7p.com"
var countdownfrom=5


var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//-->
</script>
<!--webbot bot="HTMLMarkup" endspan --></p>
<font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
29Jul/090

How to automatically maximize the browser window when a visitor accesses your website

Here is how you can automatically maximize the browser window when a visitor accesses your website.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
<!-- START OF Window Auto Maximize DHTML -->

<!-- SUMMARY BRIEF

 This code will automatically maximize the
 browser window when the page is loaded.

-->

<!-- Put this code inside of your <HEAD> tag. -->

<script language="JavaScript1.2">
<!--

top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}

//-->
</script>

<!-- END OF Window Auto Maximize DHTML -->
<font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
29Jul/090

How to move/shake the internet explorer window when a visitor accesses your website

Here is how you can move/shake the internet explorer window when a visitor accesses your website.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
<!-- START CODE Powered javascript code by WWW.javakhafan.7p.COM-->

<meta http-equiv="Content-Language" content="en-us">
<SCRIPT language=JavaScript>
<!-- Begin
function shake(n) {
if (parent.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {

parent.moveBy(-i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
parent.moveBy(0,-i);
parent.moveBy(i,0);
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,i);
 }
 }
 }

}
//  End -->

<!--
shake(1);
//-->
 </SCRIPT>
<font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
28Jul/090

How to have your visitor add your website to his web browser bookmarks with just a click

Here is how you can have your visitor add your website to his web browser bookmarks with just a click.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
<!-- Start of Add to Favorites IE -->
<!-- Put this script anywhere in your webpage and when a visitor goes
 to your webpage using Internet Explorer, they only need to
 click on the link to add your webpage to their FAVORITES
 folder.  Netscape users will simply get a reminder to press
 CTRL-D to bookmark.
-->

<SCRIPT LANGUAGE="JavaScript">
<!--
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

var url="http://www.webloger.5u.com";
var title="Webloger - Web Authoring Tools";

document.write('<A HREF="javascript:window.ext');
document.write('ernal.AddFavorite(url,title);" ');
document.write('onMouseOver=" window.status=');
document.write("'Add our site to your favorites!'; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('">Add our site to your favorites!</a>');
}
else {
var msg = "Don't forget to bookmark us!";
if(navigator.appName == "Netscape") msg += "  (CTRL-D)";
document.write(msg);
}

// -->
</script>
<!-- End of Add to Favorites IE -->

<font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
28Jul/090

How to allow your website visitor to have the option to save the webpage he is on your website

Here is how you can allow your website visitor to have the option to save the webpage he is on your website.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
// IMPORTANT:
// If you add this script to a script-library or a script-archive
// you have to insert a link to http://www.javakhafan.9f.com
// right into the webpage where the script will be displayed.

function doSaveAs(){
 if (document.execCommand){
 document.execCommand("SaveAs")
 }
 else {
 alert("Save-feature available only in Internet Exlorer 5.x.")
 }
}
</script>
<form>
<input type="button" value="Save This WebPage" onClick="doSaveAs()"
</form>

<font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/category/java/javascript-codes/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>