Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Problem with javascript include


Message #1 by "Smitha" <learner_jsp@y...> on Tue, 11 Dec 2001 21:38:56
I bet there isn't a problem with that.
It's a relative URL...

The problem might be if the JS file is placed in that folder, or the name of
the JS file is correct spelled etc...


But place an alert in the JS file to check if it gets included at all (e.g.
alert("Yes, I'm included!");)


/Robert


-----Original Message-----
From: Ken Stanley [mailto:ken.stanley@b...] 
Sent: den 12 december 2001 11:04
To: JavaScript HowTo
Subject: [javascript_howto] Re: Problem with javascript include


There seems to be a problem with this code for a start:

> src="/javaScripts/testScript.js"></script>

Shouldn't it be:

> src="../javaScripts/testScript.js"></script>

or:

> src="javaScripts/testScript.js"></script>


----- Original Message -----
From: "Smitha" <learner_jsp@y...>
To: "JavaScript HowTo" <javascript_howto@p...>
Sent: Tuesday, December 11, 2001 9:38 PM
Subject: [javascript_howto] Problem with javascript include


> Hi,
>
> I am trying to include a javascript file in the html file. As I execute
> the html file, it is producing javascript error like 'Object Expected'. I
> could not trace out where my mistake is. Appreciate if some one help me
> out in this regard.
>
> Smitha
>
> My code is as under:
> =================================================================
> test.html
> ---------
> <html>
>   <head>
>     <script language="JavaScript"
> src="/javaScripts/testScript.js"></script>
>   </head>
>   <body>
>     <form>
>        <input type="button" name="test" value="Test OK" onClick="getOK()">
>        <input type="button" name="close" value="Close"
onClick="closeMe()">
>     </form>
>   </body>
> </html>
>
> testScript.js
> -------------
> <SCRIPT LANGUAGE="JavaScript">
>   function getOK() {
>     alert("Test is OK");
>   }
>   function closeMe() {
>     window.close();
>   }
> </SCRIPT>
>
$subst('Email.Unsub').


$subst('Email.Unsub').

  Return to Index