Forum Moderators: coopster & phranque

Message Too Old, No Replies

onmouseover doesnt work in CGI

how to write onmouseover in perlcgi

         

smrithi

9:05 am on Sep 20, 2006 (gmt 0)

10+ Year Member



this is the way i gave for the onmouseover function to work but the onmouseover event doesnt work.

<a href=\"\" onmouseover=\"ajax_showTooltip('demo-pages/js-calendar.html',this);return false\" onmouseout=\"ajax_hideTooltip()\">Info</a>

the link is formed but the onmouseover event is not activated when the mouse is on the link.
please help!
thanks in advance

mikeyb

9:30 am on Sep 20, 2006 (gmt 0)

10+ Year Member



Hi,

Works fine for me, generated html looks okay, and it's trying to fire the ajax_showTooltip and ajax_hideTooltip functions (as in I get an error because it can't find the functions)

Mike

smrithi

11:27 am on Sep 20, 2006 (gmt 0)

10+ Year Member



hi mike,
this is just a simple part of the program. the statement has been given in a cgi script and it shud work but it isnt :(.Shall i send the whole script to u?

mikeyb

12:21 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



Hi,

I printed that line out using a little perl script:
-----------------
#!/usr/bin/perl -w

use strict;
use CGI ':standard';

print header;

print qq{<a href=\"\" onmouseover=\"ajax_showTooltip('demo-pages/js-calendar.html',this);return false\" onmouseout=\"ajax_hideTooltip()\">Info</a>};
-----------------

Which outputs this to the browser:
<a href="" onmouseover="ajax_showTooltip('demo-pages/js-calendar.html',this);return false" onmouseout="ajax_hideTooltip()">Info</a>

This code is correct and works fine, so as long as you see that when you view source from your browser, there is nothing wrong with that particular code.

If the onmouseover is not working, it's most likely a javascript error which you should see in your browser, use Firefox to see javascript errors better.

perl_diver

1:35 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



You don't need to escape double-quotes in a qq string, which is basically the whole point of using qq:

print qq{<a href="#" onmouseover="ajax_showTooltip('demo-pages/js-calendar.html',this);return false" onmouseout="ajax_hideTooltip()">Info</a>};

Try using a full url here:

http://www.example.com/demo-pages/js-calendar.html

or a relative URL:

../demo-pages/js-calendar.html