Microsoft® FrontPage®
FrontPage 2000, FrontPage 2002 - FrontPage 2003, Find: help, templates, tutorials, DWT, DRW, DIW @ www.FrontPageWiz.com
 
FrontPage & Expression Hosting - "FREE 3 MONTHS"
Plus Free Web Site Repairs "Site Doctor" Click Here.

 
 

New!!
FrontPage Forums
FrontPage 2003
FrontPage 2002
FrontPage 2000
FrontPage 97/98

Microsoft Excel Tools

 

 

 

 

 

Quick JS -ASP Scripts - Code Snippets



Keep a window on top:

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


Open new window to a specific size-
Body onload set window size:
(goes on the target page- add to or replacing the body tag)

<body onLoad="self.resizeTo(400,500)">


Forward a page using meta refresh, this goes in the head. It will sent the user to whatever page you indicate.
 

This script sends the user to the page in 10 seconds. Goes between the head tags.
<meta http-equiv="refresh" content="10;URL=http://www.frontpagewiz.com">

This Script uses JavaScript to send a user to a new page on load. *FrontPage 2003 has this feature built into Behaviors.

<html>
<head>
<title></title>
<script language="JavaScript">
<!--
function GoToPage(url) {
window.location=url;
}
// -->
</script>
</head>
<body onload="GoToPage('http://www.frontpagewiz.com')">

</body>
</html>

Image Rollover, ok this is not so short but I get a lot of request for this:

Select All


The input buttons on this site:
History Back -1

<input type=button value="&lt;&lt; BACK" onclick="history.back()" style="font-size: 10pt; border: 3px double #000000; background-color: #FFFFFF" >


Invite Google: Have the Google Search Engine index your website.

<META NAME="GOOGLEBOT" CONTENT="INDEX, FOLLOW">


Make this page your home page

<a class="chlnk" style="cursor:hand" href onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.frontpagewiz.com');">Make this page your home page</a>

Simple Marquee

<marquee>Hello World!</marquee>

Hello World!


Send email using aspx - ASP.NET


User Details

<script language="JavaScript" type="text/javascript">
<!--
brName = navigator.appName;
brVersion = navigator.appVersion;
brCode = navigator.appCodeName;
usPlatform = navigator.platform;
pvHistory = history.length;
scWidth = screen.width;
scHeight = screen.height;
scDepth = screen.colorDepth;
scColors = screen.colorDepth;
scColors = Math.pow (2, scColors);

document.write("<table border=2 cellpadding=1 cellspacing=0>");

document.write("<tr><td><b>Browser</b></td><td>", brName, "</td></tr>");
document.write("<tr><td><b>Version</b></td><td>", brVersion, "</td></tr>");
document.write("<tr><td><b>Code Name</b></td><td>", brCode, "</td></tr>");
document.write("<tr><td><b>Platform</b></td><td>", usPlatform, "</td></tr>");
document.write("<tr><td><b>History Items</b></td><td>", pvHistory, "</td></tr>");
document.write("<tr><td><b>Screen Resolution</b></td><td>", scWidth, " X ", scHeight, "</td></tr>");
document.write("<tr><td><b>Color Depth</b></td><td>", scDepth, "</td></tr>");
document.write("<tr><td><b>Color Display</b></td><td>", scColors, "</td></tr>");

document.write("</table>");
//-->
</script>

View Source

Click here to view/copy source!

<script>
<!--
function viewthesource(){
window.location="view-source:"+window.location
}
//-->
</script><a href="javascript:viewthesource()">Click here to view/copy source!</a>

 

Do a PopUp Window!!

<!--goes in-between the <head> section in code view-->
<script>
function doPopUp(){
doPopUpWindow = window.open("http://frontpagewiz.com/tools/metatag-generator .asp","FrontPageWiz","scrollbars=yes,resizable=yes,left=200, top=200,screenX=200,screenY=200,width=300,height=400");
}
</script>
<!--Goes in-between the <body> tags in code view-->
<a href="javascript:doPopUp()">Do a PopUp Window!!</a>

 

Create PopUps in 2 1/2 minutes - No html skills required!!

**Editors Top Pick
**Users Top Pick

Simple To Use Software Makes Creating Popups So Easy, A Child Can Do It! 

If You Ever Wanted To Use The Power of PopUps, This Software Is For You!

Order Now and Receive Master Resell Rights, Keep 100% of The Profits!

BRAND NEW, Cookie Based Popups Too!

**Editors note: this is a extremely useful feature not found in any other software in this price range.

PopUp Generator also, lets you utilize cookie based popups. 

Have you ever navigated around a site and every time you came back to the main page the popup came up again. How annoying is that?

You don't have to put your customers and prospects through a popup nightmare. With Popup Generator, you can select the number of times a popup will show. 

For example, you can set it to "0" and it will popup every time a person comes to the page. Set it to "1" and they will only see your popup once per day. Set it to "999" and they will never see your popup again. 

Open 2 Popup windows with one click.
You may use this script for just 1 popup or as may popups as you like.

Auto open 2 Popup windows on page unload (exit).
You may use this script for just 1 popup or as may popups as you like.

Auto open 2 Popup windows on page load.
You may use this script for just 1 popup or as may popups as you like.

Sample with just one popup window, just remove 1 line:
("http://www.frontpagewiz.com","left","left=20,
top=20,screenX=20,screenY=20,width=200,height=300");


How to write day and time in:

ASP

7/19/2008 7:54:54 PM
 

<%=Month(Now)&"/"&Day(Now)&"/"&Year(Now) %><% =Space(1) %><%=Time()%>

JavaScript


 

<SCRIPT Language="JavaScript">
<!--
  var curDateTime = new Date()
  document.write(curDateTime.toLocaleString())
//-->
</SCRIPT>

Set window size script, just cut it down to get what you want.

>See it in action.

Provided by:
http://www.jsmadeeasy.com

Note: You can also do this with FrontPage 2003 Behaviors.

Another approach...

<script LANGUAGE="JavaScript" FOR="window" EVENT="onload()">
<!--
//script by Oogle
//can only be used when running
//in 800x600 resolution

window.moveTo(0, 0)
window.resizeTo(800, 600)

//-->
</script>

Note; You can also do this with FrontPage 2003 Behaviors

Another approach...

<SCRIPT LANGUAGE="JavaScript">

function Minimize()
{
window.innerWidth = 100;
window.innerHeight = 100;
window.screenX = screen.width;
window.screenY = screen.height;
alwaysLowered = true;
}

function Maximize()
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
</SCRIPT>

<A HREF="javascript:onClick=Minimize()">Minimize</A>
<A HREF="javascript:onClick=Maximize()">Maximize</A>

http://www.htmlgoodies.com


This script will set the X,Y coordinates on load.

<Body onLoad="moveTo(0,0);" >

Refresh a page once on load.

<body onLoad="if (location.href.indexOf('reload')==-1) location.replace(location.href+'?reload')">

Open Print Dialog Box On Page Load Script.

<body onLoad="window.print()">

Sample

Print This Page Button.

<input type="button" value="Print Page" name="PrintBtn" onClick="window.print()">

Sample:

Print This Page Link.

<a href="javascript:void(window.print())">Print this Page</a>

Sample

Print this Page

Bookmark This Page

<span style="border: 1px dashed rgb(51, 51, 51); padding: 3px;">
<script type="text/javascript">
var text = "Bookmark This Page!"
// Add your website URL between the quotations below
var site = "http://www.frontpagewiz.com";
// Add your site description in the quotations below
var desc = "Webtools for FrontPage Webmasters"
var ver = navigator.appName
var num = parseInt(navigator.appVersion)
if ((ver == "Microsoft Internet Explorer")&&(num >= 4))
{
document.write('<a title="Bookmark this page" href="javascript:window.external.AddFavorite(site,desc);" ');
document.write('onMouseOver=" window.status=')
document.write("text; return true ")
document.write('"onMouseOut=" window.status=')
document.write("' '; return true ")
document.write('">'+ text + '</a>')
}
else
{
text += " (Ctrl+D)"
document.write(text)
}
</script> </span>

Sample:


Focus on a form element.

<form name="form1" action="my_page.asp" method="post">
<input type="text" name="email">
<input type="submit" value="submit">
</form>
<script language="JavaScript"> document.forms[0].email.focus(); </script>

Read Only Form Field

<input NAME="ID" VALUE="Welcome Back" readOnly size="20" style="border: 1px solid #000000">

How to display a visitors IP address. I get this question all the time The page you put this code on must end with .asp

Your IP address is: 38.103.63.18

The DNS lookup of the IP address is: 38.103.63.18

<strong>Your IP address is:</strong>
<%Response.Write(Request.ServerVariables("remote_host"))%>
</p>
<strong>The DNS lookup of the IP address is:</strong>
<%Response.Write(Request.ServerVariables("remote_host"))%>
</p>

Encrypt your email address - Hide your email address from Spam Harvesters:

<script language=javascript>

<!--

var contact = "email name"

var email = "you"

var emailHost = "yourwebsite.com?subject=what_do_you_want_in_the_subject_line"

document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + contact + "</a>" + "")

//-->

</script>

 

 

 

 

 
 

 

 

 

 

Home

© Copyright 2004 Frontpagewiz.com. All Rights Reserved.


www.frontpagewiz.com 

asp bugs Buttons dbarticles Whats_New frontpage_how_to Graphics hosting Folder Permissions IIS5
Time Links Asset Protection
microsoft_support  FrontPage Web rings tables Templates tools tutorials beginners behaviors
buttons
code_snippets components customizing ROI diw formatting forms press release headers Real Estatelogin_scripts navigation
Real Estate sharepoint
tables video web_dictionary webmaster articles domains tools web_design marconow.com webwizguide

 

 

 

FrontPage Resources     Privacy Statement     Disclaimers    TOC

 ©2003-2007, frontpagewiz.com All rights reserved.