Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Problem with using JScript and VBScript in One File


Message #1 by anhdo@a... on Mon, 19 Nov 2001 20:12:12
How would I change the following JScript code below to work with VBScript 

on my ASP document.  Since my VBScript already has <%@languague 

="VBScript"%> how can I also use JScript too?  



I get the error: Active Server Pages, ASP 0141 (0x80004005)

The @ command can only be used once within the Active Server Page.



I want to modify the script below so that it no longer has the first line 

and I can embed it in one of my ASP documents?  How do I accomplish this?  

If you don't understand my question please email me at anhdo@a...  

Thank you!

----------------------------------------------------



<%@language = "JScript" %>



<%

   var feedId = 62;



   var refresher = new Date(  );

   var refresherMinutes = refresher.getMinutes(  );

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 );

   refresher.setMinutes( refresherMinutes, 0, 0 );



   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" )

   var newzsnap = ctrl.retrieve

( "http://www.lobbynet.com/ppc_center_deliver/" +

                                 "deliver_articles.asp", 2,

                                 "searchId=" + String( feedId ) + "&" +

                                 "forceReload=" + refresher.getTime(  ),

                                 "", "" );

   var ctrl = null;

 %>



<%= newzsnap %>

Message #2 by Kyle Burns <kburns@c...> on Mon, 19 Nov 2001 15:08:12 -0500
You need to use the RUNAT attribute of your script element...

<SCRIPT LANGUAGE="JScript" RUNAT="Server">







=================================

Kyle M. Burns, MCSD, MCT

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 



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

From: anhdo@a... [mailto:anhdo@a...]

Sent: Monday, November 19, 2001 3:12 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Problem with using JScript and VBScript in One

File





How would I change the following JScript code below to work with VBScript 

on my ASP document.  Since my VBScript already has <%@languague 

="VBScript"%> how can I also use JScript too?  



I get the error: Active Server Pages, ASP 0141 (0x80004005)

The @ command can only be used once within the Active Server Page.



I want to modify the script below so that it no longer has the first line 

and I can embed it in one of my ASP documents?  How do I accomplish this?  

If you don't understand my question please email me at anhdo@a...  

Thank you!

----------------------------------------------------



<%@language = "JScript" %>



<%

   var feedId = 62;



   var refresher = new Date(  );

   var refresherMinutes = refresher.getMinutes(  );

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 );

   refresher.setMinutes( refresherMinutes, 0, 0 );



   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" )

   var newzsnap = ctrl.retrieve

( "http://www.lobbynet.com/ppc_center_deliver/" +

                                 "deliver_articles.asp", 2,

                                 "searchId=" + String( feedId ) + "&" +

                                 "forceReload=" + refresher.getTime(  ),

                                 "", "" );

   var ctrl = null;

 %>



<%= newzsnap %>






$subst('Email.Unsub')

Message #3 by "Do, Anh" <Anhdo@a...> on Mon, 19 Nov 2001 15:16:52 -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_01C17137.208F5990

Content-Type: text/plain



I tried using <SCRIPT LANGUAGE="JScript" RUNAT="Server"> but then <% in the code come up as a syntax error.

This is what I tried below:



----------------------------------

<SCRIPT LANGUAGE="JScript" RUNAT="Server">

	<%

	   var feedId = 62;



	   var refresher = new Date(  );

	   var refresherMinutes = refresher.getMinutes(  );

	   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 );

	   refresher.setMinutes( refresherMinutes, 0, 0 );



	   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" )

	   var newzsnap = ctrl.retrieve

	( "http://www.lobbynet.com/ppc_center_deliver/" +

	                                 "deliver_articles.asp", 2,

	                                 "searchId=" + String( feedId ) + "&" +

	                                 "forceReload=" + refresher.getTime(  ),

	                                 "", "" );

	   var ctrl = null;

	 %>



	<%= newzsnap %>

	</SCRIPT>

---------------------





> -----Original Message-----

> From:	Kyle Burns [SMTP:kburns@c...]

> Sent:	Monday, November 19, 2001 3:08 PM

> To:	ASP Web HowTo

> Subject:	[asp_web_howto] RE: Problem with using JScript and VBScript in On e File

> 

> You need to use the RUNAT attribute of your script element...

> <SCRIPT LANGUAGE="JScript" RUNAT="Server">

> 

> 

> 

> =================================

> Kyle M. Burns, MCSD, MCT

> ECommerce Technology Manager

> Centra Credit Union

> kburns@c...

> 

>  

> 

> -----Original Message-----

> From: anhdo@a... [mailto:anhdo@a...]

> Sent: Monday, November 19, 2001 3:12 PM

> To: ASP Web HowTo

> Subject: [asp_web_howto] Problem with using JScript and VBScript in One

> File

> 

> 

> How would I change the following JScript code below to work with VBScript 

> on my ASP document.  Since my VBScript already has <%@languague 

> ="VBScript"%> how can I also use JScript too?  

> 

> I get the error: Active Server Pages, ASP 0141 (0x80004005)

> The @ command can only be used once within the Active Server Page.

> 

> I want to modify the script below so that it no longer has the first line 

> and I can embed it in one of my ASP documents?  How do I accomplish this?  

> If you don't understand my question please email me at anhdo@a...  

> Thank you!

> ----------------------------------------------------

> 

> <%@language = "JScript" %>

> 

> <%

>    var feedId = 62;

> 

>    var refresher = new Date(  );

>    var refresherMinutes = refresher.getMinutes(  );

>    refresherMinutes = refresherMinutes - ( refresherMinutes % 5 );

>    refresher.setMinutes( refresherMinutes, 0, 0 );

> 

>    var ctrl = Server.CreateObject( "SOFTWING.ASPtear" )

>    var newzsnap = ctrl.retrieve

> ( "http://www.lobbynet.com/ppc_center_deliver/" +

>                                  "deliver_articles.asp", 2,

>                                  "searchId=" + String( feedId ) + "&" +

>                                  "forceReload=" + refresher.getTime(  ),

>                                  "", "" );

>    var ctrl = null;

>  %>

> 

> <%= newzsnap %>

> 




> $subst('Email.Unsub')

> 







Message #4 by Kyle Burns <kburns@c...> on Mon, 19 Nov 2001 15:19:24 -0500
The <SCRIPT> and </SCRIPT> tags are your script delimeters in this scenario.

Omit <% and %>.  Why would you want to mix your script anyway?  This really

cuts the maintainability of your page and adds to processing time because

another script engine needs to be loaded.





=================================

Kyle M. Burns, MCSD, MCT

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 



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

From: Do, Anh [mailto:Anhdo@a...]

Sent: Monday, November 19, 2001 3:17 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Problem with using JScript and VBScript i n On

e File





I tried using <SCRIPT LANGUAGE="JScript" RUNAT="Server"> but then <% in the

code come up as a syntax error. 

This is what I tried below: 

---------------------------------- 

<SCRIPT LANGUAGE="JScript" RUNAT="Server"> 

<% 

   var feedId = 62; 

   var refresher = new Date(  ); 

   var refresherMinutes = refresher.getMinutes(  ); 

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

   refresher.setMinutes( refresherMinutes, 0, 0 ); 

   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

   var newzsnap = ctrl.retrieve 

( "http://www.lobbynet.com/ppc_center_deliver/" + 

                                 "deliver_articles.asp", 2, 

                                 "searchId=" + String( feedId ) + "&" + 

                                 "forceReload=" + refresher.getTime(  ), 

                                 "", "" ); 

   var ctrl = null; 

 %> 

<%= newzsnap %> 

</SCRIPT> 

--------------------- 





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

From:   Kyle Burns [SMTP:kburns@c...] 

Sent:   Monday, November 19, 2001 3:08 PM 

To:     ASP Web HowTo 

Subject:        [asp_web_howto] RE: Problem with using JScript and VBScript

in On e File 

You need to use the RUNAT attribute of your script element... 

<SCRIPT LANGUAGE="JScript" RUNAT="Server"> 







================================= 

Kyle M. Burns, MCSD, MCT 

ECommerce Technology Manager 

Centra Credit Union 

kburns@c... 

 

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

From: anhdo@a... [mailto:anhdo@a...] 

Sent: Monday, November 19, 2001 3:12 PM 

To: ASP Web HowTo 

Subject: [asp_web_howto] Problem with using JScript and VBScript in One 

File 





How would I change the following JScript code below to work with VBScript 

on my ASP document.  Since my VBScript already has <%@languague 

="VBScript"%> how can I also use JScript too?  

I get the error: Active Server Pages, ASP 0141 (0x80004005) 

The @ command can only be used once within the Active Server Page. 

I want to modify the script below so that it no longer has the first line 

and I can embed it in one of my ASP documents?  How do I accomplish this?  

If you don't understand my question please email me at anhdo@a...  

Thank you! 

---------------------------------------------------- 

<%@language = "JScript" %> 

<% 

   var feedId = 62; 

   var refresher = new Date(  ); 

   var refresherMinutes = refresher.getMinutes(  ); 

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

   refresher.setMinutes( refresherMinutes, 0, 0 ); 

   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

   var newzsnap = ctrl.retrieve 

( "http://www.lobbynet.com/ppc_center_deliver/" + 

                                 "deliver_articles.asp", 2, 

                                 "searchId=" + String( feedId ) + "&" + 

                                 "forceReload=" + refresher.getTime(  ), 

                                 "", "" ); 

   var ctrl = null; 

 %> 

<%= newzsnap %> 

--- 



$subst('Email.Unsub') 

--- 



$subst('Email.Unsub') 




$subst('Email.Unsub')

Message #5 by "Johnson, Israel" <IJohnson@R...> on Mon, 19 Nov 2001 15:35:41 -0500
<Script Language="JScript" RunAt ="Server">

	//script goes here



</Script>



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

From: anhdo@a... [mailto:anhdo@a...]

Sent: Monday, November 19, 2001 3:12 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Problem with using JScript and VBScript in One

File





How would I change the following JScript code below to work with VBScript 

on my ASP document.  Since my VBScript already has <%@languague 

="VBScript"%> how can I also use JScript too?  



I get the error: Active Server Pages, ASP 0141 (0x80004005)

The @ command can only be used once within the Active Server Page.



I want to modify the script below so that it no longer has the first line 

and I can embed it in one of my ASP documents?  How do I accomplish this?  

If you don't understand my question please email me at anhdo@a...  

Thank you!

----------------------------------------------------



<%@language = "JScript" %>



<%

   var feedId = 62;



   var refresher = new Date(  );

   var refresherMinutes = refresher.getMinutes(  );

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 );

   refresher.setMinutes( refresherMinutes, 0, 0 );



   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" )

   var newzsnap = ctrl.retrieve

( "http://www.lobbynet.com/ppc_center_deliver/" +

                                 "deliver_articles.asp", 2,

                                 "searchId=" + String( feedId ) + "&" +

                                 "forceReload=" + refresher.getTime(  ),

                                 "", "" );

   var ctrl = null;

 %>



<%= newzsnap %>






$subst('Email.Unsub')

Message #6 by "Do, Anh" <Anhdo@a...> on Mon, 19 Nov 2001 15:36:04 -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_01C17139.CEEF5330

Content-Type: text/plain;

	charset="iso-8859-1"



Thanks!  I solved the problem.  The reason we are using two different types of script is that we are embedding a special client that
we did not create.  Since we originally created our page in VBscript we had to modify it to add this JScript code.



The code worked for me when I did this:

---------------------------------------------------------------------

<SCRIPT LANGUAGE="JScript" RUNAT="Server">





   var feedId = 62;



   var refresher = new Date(  );

   var refresherMinutes = refresher.getMinutes(  );

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 );

   refresher.setMinutes( refresherMinutes, 0, 0 );



   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" )

   var newzsnap = ctrl.retrieve( "http://www.lobbynet.com/ppc_center_deliver/" +

                                 "deliver_articles.asp", 2,

                                 "searchId=" + String( feedId ) + "&" +

                                 "forceReload=" + refresher.getTime(  ),

                                 "", "" );

   var ctrl = null;

</SCRIPT>

<%= newzsnap %>







> -----Original Message-----

> From:	Kyle Burns [SMTP:kburns@c...]

> Sent:	Monday, November 19, 2001 3:19 PM

> To:	ASP Web HowTo

> Subject:	[asp_web_howto] RE: Problem with using JScript and VBScript i n On e File

> 

> The <SCRIPT> and </SCRIPT> tags are your script delimeters in this scenario.

> Omit <% and %>.  Why would you want to mix your script anyway?  This really

> cuts the maintainability of your page and adds to processing time because

> another script engine needs to be loaded.

> 

> 

> =================================

> Kyle M. Burns, MCSD, MCT

> ECommerce Technology Manager

> Centra Credit Union

> kburns@c...

> 

>  

> 

> -----Original Message-----

> From: Do, Anh [mailto:Anhdo@a...]

> Sent: Monday, November 19, 2001 3:17 PM

> To: ASP Web HowTo

> Subject: [asp_web_howto] RE: Problem with using JScript and VBScript i n On

> e File

> 

> 

> I tried using <SCRIPT LANGUAGE="JScript" RUNAT="Server"> but then <% in the

> code come up as a syntax error. 

> This is what I tried below: 

> ---------------------------------- 

> <SCRIPT LANGUAGE="JScript" RUNAT="Server"> 

> <% 

>    var feedId = 62; 

>    var refresher = new Date(  ); 

>    var refresherMinutes = refresher.getMinutes(  ); 

>    refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

>    refresher.setMinutes( refresherMinutes, 0, 0 ); 

>    var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

>    var newzsnap = ctrl.retrieve 

> ( "http://www.lobbynet.com/ppc_center_deliver/" + 

>                                  "deliver_articles.asp", 2, 

>                                  "searchId=" + String( feedId ) + "&" + 

>                                  "forceReload=" + refresher.getTime(  ), 

>                                  "", "" ); 

>    var ctrl = null; 

>  %> 

> <%= newzsnap %> 

> </SCRIPT> 

> --------------------- 

> 

> 

> -----Original Message----- 

> From:   Kyle Burns [SMTP:kburns@c...] 

> Sent:   Monday, November 19, 2001 3:08 PM 

> To:     ASP Web HowTo 

> Subject:        [asp_web_howto] RE: Problem with using JScript and VBScript

> in On e File 

> You need to use the RUNAT attribute of your script element... 

> <SCRIPT LANGUAGE="JScript" RUNAT="Server"> 

> 

> 

> 

> ================================= 

> Kyle M. Burns, MCSD, MCT 

> ECommerce Technology Manager 

> Centra Credit Union 

> kburns@c... 

>  

> -----Original Message----- 

> From: anhdo@a... [mailto:anhdo@a...] 

> Sent: Monday, November 19, 2001 3:12 PM 

> To: ASP Web HowTo 

> Subject: [asp_web_howto] Problem with using JScript and VBScript in One 

> File 

> 

> 

> How would I change the following JScript code below to work with VBScript 

> on my ASP document.  Since my VBScript already has <%@languague 

> ="VBScript"%> how can I also use JScript too?  

> I get the error: Active Server Pages, ASP 0141 (0x80004005) > 

> The @ command can only be used once within the Active Server Page. 

> I want to modify the script below so that it no longer has the first line 

> and I can embed it in one of my ASP documents?  How do I accomplish this?  

> If you don't understand my question please email me at anhdo@a...  

> Thank you! 

> ---------------------------------------------------- 

> <%@language = "JScript" %> 

> <% 

>    var feedId = 62; 

>    var refresher = new Date(  ); 

>    var refresherMinutes = refresher.getMinutes(  ); 

>    refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

>    refresher.setMinutes( refresherMinutes, 0, 0 ); 

>    var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

>    var newzsnap = ctrl.retrieve 

> ( "http://www.lobbynet.com/ppc_center_deliver/" + 

>                                  "deliver_articles.asp", 2, 

>                                  "searchId=" + String( feedId ) + "&" + 

>                                  "forceReload=" + refresher.getTime(  ), 

>                                  "", "" ); 

>    var ctrl = null; 

>  %> 

> <%= newzsnap %> 

> --- 



> $subst('Email.Unsub') 

> --- 



> $subst('Email.Unsub') 




> $subst('Email.Unsub')

> 







Message #7 by Kyle Burns <kburns@c...> on Mon, 19 Nov 2001 15:39:48 -0500
It seems like this should also work in VBScript with minimal re-working.  Is

there a reason this won't work?



=================================

Kyle M. Burns, MCSD, MCT

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 



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

From: Do, Anh [mailto:Anhdo@a...]

Sent: Monday, November 19, 2001 3:36 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Problem with using JScript and VBScript i n On

e File





Thanks!  I solved the problem.  The reason we are using two different types

of script is that we are embedding a special client that we did not create.

Since we originally created our page in VBscript we had to modify it to add

this JScript code.

The code worked for me when I did this: 

--------------------------------------------------------------------- 

<SCRIPT LANGUAGE="JScript" RUNAT="Server"> 





   var feedId = 62; 

   var refresher = new Date(  ); 

   var refresherMinutes = refresher.getMinutes(  ); 

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

   refresher.setMinutes( refresherMinutes, 0, 0 ); 

   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

   var newzsnap = ctrl.retrieve(

"http://www.lobbynet.com/ppc_center_deliver/" + 

                                 "deliver_articles.asp", 2, 

                                 "searchId=" + String( feedId ) + "&" + 

                                 "forceReload=" + refresher.getTime(  ), 

                                 "", "" ); 

   var ctrl = null; 

</SCRIPT> 

<%= newzsnap %> 







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

From:   Kyle Burns [SMTP:kburns@c...] 

Sent:   Monday, November 19, 2001 3:19 PM 

To:     ASP Web HowTo 

Subject:        [asp_web_howto] RE: Problem with using JScript and VBScript

i n On e File 

The <SCRIPT> and </SCRIPT> tags are your script delimeters in this scenario.



Omit <% and %>.  Why would you want to mix your script anyway?  This really 

cuts the maintainability of your page and adds to processing time because 

another script engine needs to be loaded. 





================================= 

Kyle M. Burns, MCSD, MCT 

ECommerce Technology Manager 

Centra Credit Union 

kburns@c... 

 

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

From: Do, Anh [mailto:Anhdo@a...] 

Sent: Monday, November 19, 2001 3:17 PM 

To: ASP Web HowTo 

Subject: [asp_web_howto] RE: Problem with using JScript and VBScript i n On 

e File 





I tried using <SCRIPT LANGUAGE="JScript" RUNAT="Server"> but then <% in the 

code come up as a syntax error. 

This is what I tried below: 

---------------------------------- 

<SCRIPT LANGUAGE="JScript" RUNAT="Server"> 

<% 

   var feedId = 62; 

   var refresher = new Date(  ); 

   var refresherMinutes = refresher.getMinutes(  ); 

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

   refresher.setMinutes( refresherMinutes, 0, 0 ); 

   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

   var newzsnap = ctrl.retrieve 

( "http://www.lobbynet.com/ppc_center_deliver/" + 

                                 "deliver_articles.asp", 2, 

                                 "searchId=" + String( feedId ) + "&" + 

                                 "forceReload=" + refresher.getTime(  ), 

                                 "", "" ); 

   var ctrl = null; 

 %> 

<%= newzsnap %> 

</SCRIPT> 

--------------------- 





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

From:   Kyle Burns [SMTP:kburns@c...] 

Sent:   Monday, November 19, 2001 3:08 PM 

To:     ASP Web HowTo 

Subject:        [asp_web_howto] RE: Problem with using JScript and VBScript 

in On e File 

You need to use the RUNAT attribute of your script element... 

<SCRIPT LANGUAGE="JScript" RUNAT="Server"> 







================================= 

Kyle M. Burns, MCSD, MCT 

ECommerce Technology Manager 

Centra Credit Union 

kburns@c... 

  

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

From: anhdo@a... [mailto:anhdo@a...] 

Sent: Monday, November 19, 2001 3:12 PM 

To: ASP Web HowTo 

Subject: [asp_web_howto] Problem with using JScript and VBScript in One 

File 





How would I change the following JScript code below to work with VBScript 

on my ASP document.  Since my VBScript already has <%@languague 

="VBScript"%> how can I also use JScript too?  

I get the error: Active Server Pages, ASP 0141 (0x80004005) 

The @ command can only be used once within the Active Server Page. 

I want to modify the script below so that it no longer has the first line 

and I can embed it in one of my ASP documents?  How do I accomplish this?  

If you don't understand my question please email me at anhdo@a...  

Thank you! 

---------------------------------------------------- 

<%@language = "JScript" %> 

<% 

   var feedId = 62; 

   var refresher = new Date(  ); 

   var refresherMinutes = refresher.getMinutes(  ); 

   refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

   refresher.setMinutes( refresherMinutes, 0, 0 ); 

   var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

   var newzsnap = ctrl.retrieve 

( "http://www.lobbynet.com/ppc_center_deliver/" + 

                                 "deliver_articles.asp", 2, 

                                 "searchId=" + String( feedId ) + "&" + 

                                 "forceReload=" + refresher.getTime(  ), 

                                 "", "" ); 

   var ctrl = null; 

 %> 

<%= newzsnap %> 

--- 



$subst('Email.Unsub') 

--- 



$subst('Email.Unsub') 

--- 



$subst('Email.Unsub') 

--- 



$subst('Email.Unsub') 




$subst('Email.Unsub')

Message #8 by "Do, Anh" <Anhdo@a...> on Mon, 19 Nov 2001 15:49:59 -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_01C1713B.C08538D0

Content-Type: text/plain



I tried using VBScript with it but when I did I got an error at the line of code:  var feedId = 62; 

I'm not sure why myself, but I assume because the code was written specifically in JScript I need to have a script tag for the
JScript..





> -----Original Message-----

> From:	Kyle Burns [SMTP:kburns@c...]

> Sent:	Monday, November 19, 2001 3:40 PM

> To:	ASP Web HowTo

> Subject:	[asp_web_howto] RE: Problem with using JScript and VBScript i n On e File

> 

> It seems like this should also work in VBScript with minimal re-working.  Is

> there a reason this won't work?

> 

> =================================

> Kyle M. Burns, MCSD, MCT

> ECommerce Technology Manager

> Centra Credit Union

> kburns@c...

> 

>  

> 

> -----Original Message-----

> From: Do, Anh [mailto:Anhdo@a...]

> Sent: Monday, November 19, 2001 3:36 PM

> To: ASP Web HowTo

> Subject: [asp_web_howto] RE: Problem with using JScript and VBScript i n On

> e File

> 

> 

> Thanks!  I solved the problem.  The reason we are using two different types

> of script is that we are embedding a special client that we did not create.

> Since we originally created our page in VBscript we had to modify it to add

> this JScript code.

> The code worked for me when I did this: 

> --------------------------------------------------------------------- 

> <SCRIPT LANGUAGE="JScript" RUNAT="Server"> 

> 

> 

>    var feedId = 62; 

>    var refresher = new Date(  ); 

>    var refresherMinutes = refresher.getMinutes(  ); 

>    refresherMinutes = refresherMinutes - ( refresherMinutes % 5 ); 

>    refresher.setMinutes( refresherMinutes, 0, 0 ); 

>    var ctrl = Server.CreateObject( "SOFTWING.ASPtear" ) 

>    var newzsnap = ctrl.retrieve(

> "http://www.lobbynet.com/ppc_center_deliver/" + 

>                                  "deliver_articles.asp", 2, 

>                                  "searchId=" + String( feedId ) + "&" + 

>                                  "forceReload=" + refresher.getTime(  ), 

>                                  "", "" ); 

>    var ctrl = null; 

> </SCRIPT> 

> <%= newzsnap %> 

> 

> 

> 

> 




Message #9 by "Jason Salas" <jason@k...> on Tue, 20 Nov 2001 08:32:08 +1000
You should only have the page's language directive declared once.  If you

use both of these anywhere in the same script:



<%@language = "JScript" %>

<%@language = "VBScript" %>



...that will produce the error.  This may also happen if you use your script

as an SSI include, or have another script included within it.



Or, you could use inline scriptblocks, such as:



<script language="JScript" RUNAT="server">

...script goes here...

</script>



HTH,

Jason





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

From: <anhdo@a...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Sent: Monday, November 19, 2001 8:12 PM

Subject: [asp_web_howto] Problem with using JScript and VBScript in One File





> How would I change the following JScript code below to work with VBScript

> on my ASP document.  Since my VBScript already has <%@languague

> ="VBScript"%> how can I also use JScript too?

>

> I get the error: Active Server Pages, ASP 0141 (0x80004005)

> The @ command can only be used once within the Active Server Page.

>

> I want to modify the script below so that it no longer has the first line

> and I can embed it in one of my ASP documents?  How do I accomplish this?

> If you don't understand my question please email me at anhdo@a...

> Thank you!

> ----------------------------------------------------

>

> <%@language = "JScript" %>

>

> <%

>    var feedId = 62;

>

>    var refresher = new Date(  );

>    var refresherMinutes = refresher.getMinutes(  );

>    refresherMinutes = refresherMinutes - ( refresherMinutes % 5 );

>    refresher.setMinutes( refresherMinutes, 0, 0 );

>

>    var ctrl = Server.CreateObject( "SOFTWING.ASPtear" )

>    var newzsnap = ctrl.retrieve

> ( "http://www.lobbynet.com/ppc_center_deliver/" +

>                                  "deliver_articles.asp", 2,

>                                  "searchId=" + String( feedId ) + "&" +

>                                  "forceReload=" + refresher.getTime(  ),

>                                  "", "" );

>    var ctrl = null;

>  %>

>

> <%= newzsnap %>

>




$subst('Email.Unsub')

>

>





Message #10 by "Jason Salas" <jason@k...> on Tue, 20 Nov 2001 08:44:15 +1000
This is a multi-part message in MIME format.



------=_NextPart_000_009A_01C1719F.88EA9BE0

Content-Type: text/plain;

	charset="Windows-1252"

Content-Transfer-Encoding: quoted-printable



RE: [asp_web_howto] RE: Problem with using JScript and VBScript i n On e 

FileThis is probably because in VBScript all variables have to be 

continuous characters, and need to be declared by dimensioning them, and 

assigning their value as follows:



DECLARING YOUR VARIABLE IN JSCRIPT:

var feedId =3D 62;



DECLARING YOUR VARIABLE IN VBSCRIPT:

Dim feedId

feedId =3D 62



Just note that in VBScript, you don't have to call variables by 

"var...", and case-sensitivity isn't an issue.





HTH,

Jason





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

  From: Do, Anh

  To: ASP Web HowTo

  Sent: Tuesday, November 20, 2001 6:49 AM

  Subject: [asp_web_howto] RE: Problem with using JScript and VBScript i 

n On e File





  I tried using VBScript with it but when I did I got an error at the 

line of code:  var feedId =3D 62;

  I'm not sure why myself, but I assume because the code was written 

specifically in JScript I need to have a script tag for the JScript..







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

    From:   Kyle Burns [SMTP:kburns@c...]

    Sent:   Monday, November 19, 2001 3:40 PM

    To:     ASP Web HowTo

    Subject:        [asp_web_howto] RE: Problem with using JScript and 

VBScript i n On e File



    It seems like this should also work in VBScript with minimal 

re-working.  Is

    there a reason this won't work?



    

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D

    Kyle M. Burns, MCSD, MCT

    ECommerce Technology Manager

    Centra Credit Union

    kburns@c...



     



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

    From: Do, Anh [mailto:Anhdo@a...]

    Sent: Monday, November 19, 2001 3:36 PM

    To: ASP Web HowTo

    Subject: [asp_web_howto] RE: Problem with using JScript and VBScript 

i n On

    e File







    Thanks!  I solved the problem.  The reason we are using two 

different types

    of script is that we are embedding a special client that we did not 

create.

    Since we originally created our page in VBscript we had to modify it 

to add

    this JScript code.

    The code worked for me when I did this:

    

---------------------------------------------------------------------

    <SCRIPT LANGUAGE=3D"JScript" RUNAT=3D"Server">







       var feedId =3D 62;

       var refresher =3D new Date(  );

       var refresherMinutes =3D refresher.getMinutes(  );

       refresherMinutes =3D refresherMinutes - ( refresherMinutes % 5 ); 



       refresher.setMinutes( refresherMinutes, 0, 0 );

       var ctrl =3D Server.CreateObject( "SOFTWING.ASPtear" )

       var newzsnap =3D ctrl.retrieve(

    "http://www.lobbynet.com/ppc_center_deliver/" +

                                     "deliver_articles.asp", 2,

                                     "searchId=3D" + String( feedId ) + 

"&" +

                                     "forceReload=3D" + 

refresher.getTime(  ),

                                     "", "" );

       var ctrl =3D null;

    </SCRIPT>

    <%=3D newzsnap %>














$subst('Email.Unsub')









  Return to Index