ASP, JavaScript and dealing with each other... 
Author Message
 ASP, JavaScript and dealing with each other...

Hello,
Imagine the following function:

<SCRIPT LANGUAGE=javascript>
 a = add2cart(); /*Returns a string*/
</SCRIPT>

Now I would like to print this string using ASP. So I decided to write this:

<%Response.Write(a)%>

And it wrote me nothing. This is really pain in the ass, since I've designed
a shopping cart using JavaScript and I can't make any relation between my
shopping cart and my database, Shopping cart is written in JavaScript, and
database section is written using ASP.

How can I use the return value of "add2cart()" function in an asp paragraph?
Any help would be highly appreciated.

Cheers,
Mehdi

--
What you need to know about modems? Take a look at
http://www.*-*-*.com/



Mon, 23 Sep 2002 03:00:00 GMT  
 ASP, JavaScript and dealing with each other...
Hi

The first part:

<SCRIPT LANGUAGE=javascript>
  a = add2cart(); /*Returns a string*/
</SCRIPT>

 is client side script and the second part:

<%Response.Write(a)%>

is server side script.
Try to execute the first part on the server side by adding the RUNAT
parameter.

<SCRIPT LANGUAGE=javascript RUNAT=SERVER>
  a = add2cart(); /*Returns a string*/
</SCRIPT>

Make sure the add2cart() function is also executed on the server side.


Quote:
> Hello,
> Imagine the following function:

> <SCRIPT LANGUAGE=javascript>
>  a = add2cart(); /*Returns a string*/
> </SCRIPT>

> Now I would like to print this string using ASP. So I decided to write
this:

> <%Response.Write(a)%>

> And it wrote me nothing. This is really pain in the ass, since I've
designed
> a shopping cart using JavaScript and I can't make any relation between my
> shopping cart and my database, Shopping cart is written in JavaScript, and
> database section is written using ASP.

> How can I use the return value of "add2cart()" function in an asp
paragraph?
> Any help would be highly appreciated.

> Cheers,
> Mehdi

> --
> What you need to know about modems? Take a look at
> http://www.tabesh.com/ata/modem



Mon, 23 Sep 2002 03:00:00 GMT  
 ASP, JavaScript and dealing with each other...
if im not absolutely too tiered right now, I would think that mixing
javascript/vbs serverside aint a very good idea, I think javascript is
compiled before vbs (or viceversa) so you might end up with some
unpredictable results, however, when using the other language stricty for
subrutines, it might work.

--

       icq#  5751353


Quote:
> Hi

> The first part:

> <SCRIPT LANGUAGE=javascript>
>   a = add2cart(); /*Returns a string*/
> </SCRIPT>

>  is client side script and the second part:

> <%Response.Write(a)%>

> is server side script.
> Try to execute the first part on the server side by adding the RUNAT
> parameter.

> <SCRIPT LANGUAGE=javascript RUNAT=SERVER>
>   a = add2cart(); /*Returns a string*/
> </SCRIPT>

> Make sure the add2cart() function is also executed on the server side.



> > Hello,
> > Imagine the following function:

> > <SCRIPT LANGUAGE=javascript>
> >  a = add2cart(); /*Returns a string*/
> > </SCRIPT>

> > Now I would like to print this string using ASP. So I decided to write
> this:

> > <%Response.Write(a)%>

> > And it wrote me nothing. This is really pain in the ass, since I've
> designed
> > a shopping cart using JavaScript and I can't make any relation between
my
> > shopping cart and my database, Shopping cart is written in JavaScript,
and
> > database section is written using ASP.

> > How can I use the return value of "add2cart()" function in an asp
> paragraph?
> > Any help would be highly appreciated.

> > Cheers,
> > Mehdi

> > --
> > What you need to know about modems? Take a look at
> > http://www.tabesh.com/ata/modem



Sat, 05 Oct 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dealing with Null efficiently in ASP...

2. Newbie question about ASP and JavaScript

3. Push JavaScript from ASP .NET

4. passing javascript variable into asp variable using vbscript

5. javascript to asp problem

6. Looking to build a Stock/News Ticker in Vbscript/ASP/or JavaScript

7. JavaScript and ASP???

8. JavaScript, VBScript in ASP - or ActiveX

9. Trying to create dynamic Javascript using ASP

10. asp and javascript

 

 
Powered by phpBB® Forum Software