Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript mouseover in vbscript

Status
Not open for further replies.

colin81

Technical User
Jul 22, 2002
77
GB
Hi All

Im quite new to asp and up to know doing ok (hmmmmm!) I am having problems using javascript mouseovers and validation within my vbscript (this works fine when used as a html page not when asp). I have looked on the web but not found a solution to my problem. An example would be:

<a href"index.html" onMouseOver="window.status='homepage';return true">Click Here</a>

Do i need to tell the script that it uses java script for this ?

Any help would be very much appreciated.

Many Thanks
Colin
 
I'm a little confused by your question. The ASP outputs pure HTML which works. The browser should be defaulting to javascript. How is it not working?

<a href="index.html" onMouseOver="window.status='homepage';return true">Click Here</a>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Hi Thanks for replying

Sorry the code I put above was only a snippit, the default language for asp pages is vbscript, and i have declared this at the top of my code . The problem I am having is using javascript onmouseovers in a vbscript asp page. Can I mix the two ?

I have tried this code using a page with a html extension and it works fine, as soon as it is named with an asp extension (and processed by the server) the onmouseovers do not work.
 
Most likely, your server-side code is in vbScript (as you define at the top of the server side asp page). However, your output is sent to the client-side browser as pure HTML and is interpreted as such. Therefore, your client-side javascript will work fine...



Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Yes thats correct, im using vbscript and client side is javascript.... when in asp format and opened directly into internet explorer the javascript executes fine, when i open it using it does not process and display any javascript.

Just as I was writing I thought to check security within ie when set to low the scripting works from localhost...im very sorry for wasting your time.

Many Thanks for your replies
Colin
 
Try this page...
Code:
<%
response.write "<h3>this is an asp page</h3>"
response.write vbcrlf
response.write "<script>" & vbcrlf &_
  "window.status = 'Javascript Success'" & vbcrlf &_
  "</script>"

response.write "<script language=vbs>" & vbcrlf &_
  "msgBox('VBS Success')" & vbcrlf &_
  "</script>"
%>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
hang on a sec - go back to the original post:

<a href"index.html" onMouseOver="window.status='homepage';return true">Click Here</a>

there is a syntax error in the html:

<a href="index.html" onMouseOver="window.status='homepage';return true">Click Here</a>

 
Hi

Sorry that was a typo in the message above, the problem has been resolved.

Many Thanks
Colin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top