Delmer MccormicAA37
New Member
I've noticed that you can set javascript variables using ASP code. For example:\[code\]var test = "<%response.write(number)%>"\[/code\]I was wondering if other types of ASP code can work in javascript, such as if statements or while loops. For Example:\[code\]function test1(){ count = 0; <%if number = 1 then%> count = count + 1; <%end if%>}function test2(){ count = 0; <%index = 0 do while index < 10 %> count = count +1; <%index = index +1 loop%>}\[/code\]I am relatively new to web development and programming so I'm not sure if this is possible. If this does not work, is there any way I can get around this or a different way to code it?Any tips or advice would be greatly appreciated.