Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: how to do dynamic loading javascript?


Message #1 by Lin Ma <linma@b...> on Tue, 27 Feb 2001 17:47:00 -0500
We usually do <script language="javascript"	SRC="aaa.js > when we want

to use the function in it.

If the function is needed only under certain condition, could we also only

load the aaa.js under that condition?



Is it doable or we have to always load the aaa.js with the page?



Thanks for your help!



Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 28 Feb 2001 10:07:21 -0000
if the condition is determined at the server side



<% if ... then %>

<script language="javascript"	SRC="aaa.js"> 

</script>

<% end if %>



-----Original Message-----

From: Lin Ma [mailto:linma@b...]

Sent: Tuesday, February 27, 2001 10:47 PM

To: ASP Web HowTo

Subject: [asp_web_howto] how to do dynamic loading javascript?





We usually do <script language="javascript"	SRC="aaa.js > when we want

to use the function in it.

If the function is needed only under certain condition, could we also only

load the aaa.js under that condition?



Is it doable or we have to always load the aaa.js with the page?



Thanks for your help!





________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com



Message #3 by Lin Ma <linma@b...> on Wed, 28 Feb 2001 07:23:39 -0500
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C0A181.480C1B60

Content-Type: text/plain;

	charset="iso-8859-1"



Thanks, Alex. But what about in client side, is there a way?



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, February 28, 2001 5:07 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: how to do dynamic loading javascript?





if the condition is determined at the server side



<% if ... then %>

<script language="javascript"	SRC="aaa.js"> 

</script>

<% end if %>



-----Original Message-----

From: Lin Ma [mailto:linma@b...]

Sent: Tuesday, February 27, 2001 10:47 PM

To: ASP Web HowTo

Subject: [asp_web_howto] how to do dynamic loading javascript?





We usually do <script language="javascript"	SRC="aaa.js > when we want

to use the function in it.

If the function is needed only under certain condition, could we also only

load the aaa.js under that condition?



Is it doable or we have to always load the aaa.js with the page?



Thanks for your help!





________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com








$subst('Email.Unsub')




Message #4 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 28 Feb 2001 12:33:47 -0000
<script language="javascript">

    if(...){

        document.write('<scr' + 'ipt language="javascript"

SRC="aaa.js"></sc' + 'ript>')

    }

</script>

 

you need to break up the word "script" in order not to confuse the ASP

engine - no need to do this in an HTML page

Message #5 by Gregory_Griffiths@c... on Wed, 28 Feb 2001 12:41:49 +0000
you may be able to use document.write to write in some lines that will 

do it, but I've not tried it ?



-----Original Message-----

From: linma@b... [mailto:linma@b...]

Sent: 28 February 2001 12:24

To: asp_web_howto@p...

Cc: linma@b...

Subject: [asp_web_howto] RE: how to do dynamic loading javascript?







Thanks, Alex. But what about in client side, is there a way? 




  Return to Index