PC Review


Reply
Thread Tools Rate Thread

How to add Java Script to my Front Page project

 
 
tmb
Guest
Posts: n/a
 
      2nd Aug 2004
I want to put some Java Script into my Front Page 2000 project.

1 - How to add "onload="loadpage()" to the body?

Should I use Insert | HTML or just go to HTML view and type it in ? Or what?

2 - How to add the actual Java Script Code?

ditto as in 1 above.

3 - Do most browsers have Java Script enabled these days ? (Or is adding
Java Script a waste of time?)

thanks for any help.




 
Reply With Quote
 
 
 
 
Jon Spivey
Guest
Posts: n/a
 
      2nd Aug 2004
Hi,
Better than 95% of users should have script enabled so it's safe enough to
use. To add an onload to the body tag you can do either
<body onload="someFunction();">
or
window.onload=someFunction;

Both do the same thing. It's best to go to HTML view and just type the code
in

--
Cheers,
Jon
Microsoft MVP

"tmb" <(E-Mail Removed)> wrote in message
news:XltPc.27674$(E-Mail Removed)...
> I want to put some Java Script into my Front Page 2000 project.
>
> 1 - How to add "onload="loadpage()" to the body?
>
> Should I use Insert | HTML or just go to HTML view and type it in ? Or

what?
>
> 2 - How to add the actual Java Script Code?
>
> ditto as in 1 above.
>
> 3 - Do most browsers have Java Script enabled these days ? (Or is adding
> Java Script a waste of time?)
>
> thanks for any help.
>
>
>
>



 
Reply With Quote
 
MD Websunlimited
Guest
Posts: n/a
 
      2nd Aug 2004
Hi TMB,

First does the script require that all elements of the page be rendered before execution? If so, then using the event handler onload
in the body tag is the way to go and it must be done via Code or HTML view. Otherwise, you could enter the script in-line with the
content.

HTH,


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible

"tmb" <(E-Mail Removed)> wrote in message news:XltPc.27674$(E-Mail Removed)...
> I want to put some Java Script into my Front Page 2000 project.
>
> 1 - How to add "onload="loadpage()" to the body?
>
> Should I use Insert | HTML or just go to HTML view and type it in ? Or what?
>
> 2 - How to add the actual Java Script Code?
>
> ditto as in 1 above.
>
> 3 - Do most browsers have Java Script enabled these days ? (Or is adding
> Java Script a waste of time?)
>
> thanks for any help.
>
>
>
>



 
Reply With Quote
 
Andrew Murray
Guest
Posts: n/a
 
      3rd Aug 2004
enabling javascript is at the discretion of the user - it is user/browser
controlled.
type in the script manually in code view
most javascripts go between the <head> and </head> tags, but read the
instructions that came with the script.


"tmb" <(E-Mail Removed)> wrote in message
news:XltPc.27674$(E-Mail Removed)...
> I want to put some Java Script into my Front Page 2000 project.
>
> 1 - How to add "onload="loadpage()" to the body?
>
> Should I use Insert | HTML or just go to HTML view and type it in ? Or what?
>
> 2 - How to add the actual Java Script Code?
>
> ditto as in 1 above.
>
> 3 - Do most browsers have Java Script enabled these days ? (Or is adding
> Java Script a waste of time?)
>
> thanks for any help.
>
>
>
>



 
Reply With Quote
 
Andrew Murray
Guest
Posts: n/a
 
      3rd Aug 2004
the onload=() might also be picked up by firewalls/pop-up blockers and therefore
not be displayed. Better off making it onclick=() then the user initiates the
popup and can decide whether to do so or not.

"Jon Spivey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
> Better than 95% of users should have script enabled so it's safe enough to
> use. To add an onload to the body tag you can do either
> <body onload="someFunction();">
> or
> window.onload=someFunction;
>
> Both do the same thing. It's best to go to HTML view and just type the code
> in
>
> --
> Cheers,
> Jon
> Microsoft MVP
>
> "tmb" <(E-Mail Removed)> wrote in message
> news:XltPc.27674$(E-Mail Removed)...
> > I want to put some Java Script into my Front Page 2000 project.
> >
> > 1 - How to add "onload="loadpage()" to the body?
> >
> > Should I use Insert | HTML or just go to HTML view and type it in ? Or

> what?
> >
> > 2 - How to add the actual Java Script Code?
> >
> > ditto as in 1 above.
> >
> > 3 - Do most browsers have Java Script enabled these days ? (Or is adding
> > Java Script a waste of time?)
> >
> > thanks for any help.
> >
> >
> >
> >

>
>



 
Reply With Quote
 
Andrew Murray
Guest
Posts: n/a
 
      3rd Aug 2004
you don't need to add the script to each page, you can do it as an external
script (which is basically a text file in notepad with a "js" file extension.

The bit of code that does go in your page is (something like) :

<script language ="javascript" src="../scripts/yourscript.js">

then you call it the same way, and the site knows where to look for that function
in "yourscript.js".

"tmb" <(E-Mail Removed)> wrote in message
news:XltPc.27674$(E-Mail Removed)...
> I want to put some Java Script into my Front Page 2000 project.
>
> 1 - How to add "onload="loadpage()" to the body?
>
> Should I use Insert | HTML or just go to HTML view and type it in ? Or what?
>
> 2 - How to add the actual Java Script Code?
>
> ditto as in 1 above.
>
> 3 - Do most browsers have Java Script enabled these days ? (Or is adding
> Java Script a waste of time?)
>
> thanks for any help.
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Front Page Script =?Utf-8?B?cmljazEzNzYw?= Microsoft Frontpage 1 29th Jan 2007 02:35 PM
Use Java Script File with Asp.Net page that uses a Master page. Larry Rebich Microsoft ASP .NET 1 2nd Dec 2006 12:43 AM
Front Page adins - java =?Utf-8?B?Qm9iMTIzNA==?= Microsoft Frontpage 1 7th Nov 2006 03:51 PM
Resizing of Java Applet when moving to Front Page =?Utf-8?B?SW5xdWlzaXRpdmU=?= Microsoft Frontpage 1 8th Dec 2004 04:44 AM
re: installing java applet into Front page Maria Loi Microsoft Frontpage 1 14th Oct 2003 08:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:52 PM.