Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Dynamic Include


Message #1 by George Smyth <george.smyth@U...> on Mon, 17 Dec 2001 11:40:21 -0500
Javascript doesn't have dim.  dim is for VBscript, if i am right.

-----Original Message-----
From: George Smyth [mailto:george.smyth@U...]
Sent: Wednesday, December 19, 2001 5:32 AM
To: javascript
Subject: [javascript] Re: Dynamic Include


Robert -

I tried this, but I'm not sure how to write the dynamic content in the below
example.  I don't get very far before I get an error:

<%@ Language=JScript%>
<%
Response.ContentType = "text/javascript"
Dim MyText
%>

The above gives me a syntax error.

Could this be something that required ASP 3.0?  We are currently using 2.0
(will be upgrading within the next month or two).

Thanks -

George L Smyth, Webmaster
U.S. Naval Academy Alumni Association

 -----Original Message-----
From: 	Nyman, Robert [mailto:Robert.Nyman@i...] 
Sent:	Tuesday, December 18, 2001 2:56 AM
To:	javascript
Subject:	[javascript] Re: Dynamic Include

Yes, if you include an ASP file in JavaScript format (see code below):


<script language="JavaScript" type="text/javascript"
src="someFile.asp"></script>


And then someFile.asp would look something like this:

<%@ Language=JScript%>
<%
	Response.ContentType = "text/javascript"
	// Dynamic content...
	// Write whatever you want it to return...	
%>



/Robert


-----Original Message-----
From: George Smyth [mailto:george.smyth@U...] 
Sent: den 17 december 2001 20:04
To: javascript
Subject: [javascript] Re: Dynamic Include


Actually, there is no code.  I'm just wondering if there is a way to make a
JavaScript include file dynamic.  If so, I would like to know how this could
be done.

Thanks -

George L Smyth

 -----Original Message-----
From: 	Shawn Beasley [mailto:datadriven80@h...] 
Sent:	Monday, December 17, 2001 1:56 PM
To:	javascript
Subject:	[javascript] Re: Dynamic Include

If you get an opportunity, post the code that is in question.


>From: George Smyth <george.smyth@U...>
>Reply-To: "javascript" <javascript@p...>
>To: "javascript" <javascript@p...>
>Subject: [javascript] Re: Dynamic Include
>Date: Mon, 17 Dec 2001 13:09:01 -0500
>
>I wish it was.  I don't believe that I can include ASP, though if I can, I
>would dearly love to know how this could be done.  Actually, this is 
>already
>written in ASP (http://usna.com/WhatsNew/Archive.asp), so if there was a 
>way
>to include it, I would only need to grab the first half dozen entries.
>
>Cheers -
>
>George L Smyth
>
>  -----Original Message-----
>From: 	Shawn Beasley [mailto:datadriven80@h...]
>Sent:	Monday, December 17, 2001 1:01 PM
>To:	javascript
>Subject:	[javascript] Re: Dynamic Include
>
>Is ".asp" an option in lieu of .js?
>
>
> >From: George Smyth <george.smyth@U...>
> >Reply-To: "javascript" <javascript@p...>
> >To: "javascript" <javascript@p...>
> >Subject: [javascript] Dynamic Include
> >Date: Mon, 17 Dec 2001 11:40:21 -0500
> >
> >I would like to create a dynamic include file (.js extension) that would
> >either get its information from a database or another Web page.  I do not
> >believe that JavaScript has the ability to do the latter.  Is the former
> >possible?
> >
> >The reason I am trying to do this is that I would like to be able to 
>offer
> >to affiliates of our organization the ability to place our content on 
>their
> >website.  I could give them a JavaScript include file that they would put
> >into their code that would display links to content on our site, but I
> >would
> >need to manually create this each time the information changed.  Since 
>this
> >information is dynamically driven from a database in the first place, it
> >would be nice to have a way where I would not have to manually alter a
> >static .js page, but it would change as the information in our database
> >changed.
> >
> >Thanks -
> >
> >George L Smyth
> >
> >
>$subst('Email.Unsub').
>
>
>_________________________________________________________________
>MSN Photos is the easiest way to share and print your photos:
>http://photos.msn.com/support/worldwide.aspx
>
>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.






  Return to Index