Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1763
Number of posts: 4498

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
is there anyway i can mix asp and javascript? Posted by dolev9 on 3 Jul 2005 at 5:22 PM
cant mix things like

<script language="javascript">
var i;
i = <%session("bla")%>
</script>

<script language="javascript">
response.write("window.scroll(0,100)");
</script>

althought mixing with html works (at least that whats written in a book of mine) like

<font size=<%i%>>

response.write("<font size=5>");


can anybody tell me how i mix them out?

thx
dolev

Report
Re: is there anyway i can mix asp and javascript? Posted by Flakes on 3 Jul 2005 at 8:56 PM
: cant mix things like
:
: <script language="javascript">
: var i;
: i = <%session("bla")%>
: </script>
:
: <script language="javascript">
: response.write("window.scroll(0,100)");
: </script>
:
: althought mixing with html works (at least that whats written in a book of mine) like
:
: <font size=<%i%>>
:
: response.write("<font size=5>");
:
:
: can anybody tell me how i mix them out?
:
: thx
: dolev
:
:


You CAN do this :

 <script language="javascript">
 var i;
 i = <%=session("bla")%>
 </script>



Response.write is serverside code, you have to enclose it within the % delimiters..

<%response.write("window.scroll(0,100);")%>



Report
Re: is there anyway i can mix asp and javascript? Posted by dolev9 on 4 Jul 2005 at 3:54 AM
thank you very much.

i test it and i think that shoud FINALY help !!!!

thanks
dolev
Report
Re: is there anyway i can mix asp and javascript? Posted by dolev9 on 4 Jul 2005 at 5:03 AM
say
that worked with that <%=bla%>

what do i do when i need to do <%bla=%>?
it tells i need to put after the = something

thanks dolev

Report
Re: is there anyway i can mix asp and javascript? Posted by Flakes on 5 Jul 2005 at 10:28 PM
: say
: that worked with that <%=bla%>
:
: what do i do when i need to do <%bla=%>?
: it tells i need to put after the = something
:
: thanks dolev
:
:


what exactly are you trying to do? I think it will help if you show a bit more code and try to explain ..


Report
Re: is there anyway i can mix asp and javascript? Posted by aaronjones3593 on 19 Jul 2005 at 1:07 AM
: : say
: : that worked with that <%=bla%>
: :
: : what do i do when i need to do <%bla=%>?
: : it tells i need to put after the = something
: :
: : thanks dolev
: :
: :
:
:
: what exactly are you trying to do? I think it will help if you show a bit more code and try to explain ..
:
:
:
I think he means set a ASP variable with a javascript value.

<%bla=%> i     or <%bla=i%>

but i dont know if thats possible i have already tried it.
Report
Re: is there anyway i can mix asp and javascript? Posted by Flakes on 19 Jul 2005 at 2:08 AM
: : : say
: : : that worked with that <%=bla%>
: : :
: : : what do i do when i need to do <%bla=%>?
: : : it tells i need to put after the = something
: : :
: : : thanks dolev
: : :
: : :
: :
: :
: : what exactly are you trying to do? I think it will help if you show a bit more code and try to explain ..
: :
: :
: :
: I think he means set a ASP variable with a javascript value.
:
:
: <%bla=%> i     or <%bla=i%>
: 

: but i dont know if thats possible i have already tried it.
:


The sequence of processing is that first all asp code is executed and then only javascript comes into play.So you can't assign a javascript value to asp variable.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.