In the external js do something similiar to:
<!--
YourFunction = function(){
// your code here
}
if (window.attachEvent)
window.attachEvent("onload", YourFunction)
else
window.onload=YourFunction;
This will "attach" the function to the onLoad event.
-->
--- In [email protected], "Jeff" <[EMAIL PROTECTED]> wrote:
>
> To make sure the js source worked I copied it into the html and
commented out the <script...src=..> line and it worked fine. I did a
view source and it looked OK there also. I then removed the js from
the html and put in the <script...src=..> line and receive the same
error as before (CheckRequirements is not defined). When I did a view
source on that html I can see the <script...src=..> line but of course
you cannot see the js it copies in.
>
> I then put js "alert" messages before and after the
<script...src=..> lines and it looks like it loads it before the
<body> tag so I cannot figure out why it says that "CheckRequirements
is not defined." I also put in js "alert" messages at the beginning
and end of the CheckRequirements routine but those never shown. When
I copied the js source into the html then the alert messages in the
CheckRequirements routine shown.
>
> I then tried using Mozilla's javaScript console and that did not
seem to help because the error shown up in the console way after the
<body> tag.
>
> I even tried an absolute path in place of the relative path and that
did the same. I checked again to see if the other js routines in the
same folder were working and they were.
>
> Stumped.
>
> If nothing else, I can always copy the js source into all the html
source that uses it. I have proven that will work.
>
> Thanks again.
> Jeff
>
> ----- Original Message -----
> From: Tom Jedrzejewicz
> To: [email protected]
> Sent: Saturday, February 04, 2006 3:02 PM
> Subject: Re: [Easy400Group] JavaScript source not getting included
in html
>
>
> Jeff ..
>
> Two thoughts ..
>
> 1 -- Have you examined the source that is actually presented to
the browser for the application that is working and the one that is
not. It stands to reason that you will find something in that comparison.
>
> 2 -- The path to the javascript file is relative rather than
absolute. Have you confirmed that it is correct for the URL that
calls the application?
>
> Take care.
>
>
> On 2/3/06, Jeff <[EMAIL PROTECTED]> wrote:
> That was a typo, also along with the "langauge". I checked the
source and the " are in there.
> Thanks
>
>
> ----- Original Message -----
> From: [EMAIL PROTECTED]
> To: [email protected]
> Sent: Friday, February 03, 2006 2:15 PM
> Subject: Re: [Easy400Group] JavaScript source not getting
included in html
>
>
>
> Jeff - You are missing a double quote after the .js in the src
tag.
>
>
>
> "Jeff" <[EMAIL PROTECTED] >
> Sent by: [email protected]
> 02/03/2006 12:10 PM Please respond to
> [email protected]
>
>
> To <[email protected]>
> cc
>
> Subject [Easy400Group] JavaScript source not
getting included in html
>
>
>
>
>
>
>
>
>
> I have a CGIDEV2 app that I am using JavaScript in and there
is some JavaScript that is in just about all pages so I want to take
that out and put it in it's own file. I have done this with other
JavaScript and it has worked fine. My problem with this one is that is
it being called by using the following:
>
> <body onLoad="CheckRequirements();">
>
> and I keep getting an error that says it cannot find the
CheckRequirements object. The following line is in the <head> tag
section:
>
> <script langauge="JavaScript"
src="/payrollh/inqswebjs1.js></script>
>
> and that is where the CheckRequirements routine is.
>
> I have checked the apache config and that looks fine. LIke I
said before, it is working with other JavaScript in the same folder
and in the same html, just not this one. I have also moved the
previous line to other sections but I always get the same message. I
am wondering if it has something to do with the onLoad part of the
<body> tag and maybe it is not loaded before the onLoad section happens.
>
> I have even tried an absolute path to the file and that has
not worked.
>
> Thanks for any help.
>
> Jeff
>
>
>
>
--------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>
> a.. Visit your group " Easy400Group" on the web.
>
> b.. To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service .
>
>
>
--------------------------------------------------------------------------
>
>
>
>
>
> SPONSORED LINKS How to format a computer hard drive Cobol
programmer Iseries 400
> How to format a computer How to format your computer
How to format computer
>
>
>
--------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> a.. Visit your group "Easy400Group" on the web.
>
> b.. To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.
>
>
>
--------------------------------------------------------------------------
>
>
>
>
> --
> Tom Jedrzejewicz
> [EMAIL PROTECTED]
>
> SPONSORED LINKS How to format a computer hard drive Cobol
programmer Iseries 400
> How to format a computer How to format your computer How
to format computer
>
>
>
------------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> a.. Visit your group "Easy400Group" on the web.
>
> b.. To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>
>
------------------------------------------------------------------------------
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Easy400Group/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/