|
-
Mar 12th, 2006, 12:04 PM
#1
Thread Starter
Addicted Member
Javascript: Can't you have VB script in it??
Hi,
I'm trying to create a javascript function that has some VB script... but it seems as once the page loads the VB script is executed without a call to the function. Is this not possible... how can I make it happen??
-------------------------------------------------------
function rotate(srcimage,direction){
n=n+direction;
if (n==allImages) n=0;
if (n==-1) n=allImages-1;
<%
if not rsProdSpecs.EOF then
rsProdSpecs.MoveNext
eProdImage = rsProdSpecs("img")
else
end if
%>
document.images[srcimage].src="images/productImages/<%=eProdImage%>";
}
-------------------------------------------------------
Thanks!
-
Mar 12th, 2006, 12:50 PM
#2
Re: Javascript: Can't you have VB script in it??
That's because the javascript is a CLIENT side script while the VBScript is a SERVER side script (ala ASP).... the server side scripting always runs first and sends the output to the browser... then and only then would the breowser be able to run the javascript.
based on what I see in the code there, I'm not sure what the problem is.
-tg
-
Mar 12th, 2006, 04:03 PM
#3
Re: Javascript: Can't you have VB script in it??
Not entirely true. VBScript is also a client-side scripting language in Internet Explorer (and only Internet Explorer, so it's not a terribly wise choice of client side language).
Although, the <% ... %> syntax suggests ASP to me. As techgnome points out you need to be clear on the difference between server side/client side scripting.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|