Gossamer Forum
Home : Products : Gossamer Links : Discussions :

onmouseover Javascript Error

Quote Reply
onmouseover Javascript Error
LinksSQL seems to be breaking up my code...

<a href="<%URL%>" onmouseover="window.status='<%SiteURL%>';return true;" onmouseout="window.status=' ';return true;"><%Title%></a>

returns

<a href="http://www.url.com" onmouseover="window.status='http://www.siteURL.com
';return true;" onmouseout="window.status=' ';return true;">My Site</a>

the problem is that '<%SiteURL%>' gets the last ' put onto the next line and causes an error on the page and the onmouseover command does nothing.

How do I keep the entire statement on a single line?

Thanks.

Last edited by:

biglion: Jan 8, 2004, 7:35 AM
Quote Reply
Re: [biglion] onmouseover Javascript Error In reply to
Try creating a new global, called chomp_it, with the following codes;

Code:
sub {
my $grab = $_[0];
$grab =~ s/[\n\s]//g;
return $grab;
}

Then use something like;


<a href="<%URL%>" onmouseover="window.status='<%chomp_it($SiteURL)%>';return true;" onmouseout="window.status=' ';return true;"><%Title%></a>

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Post deleted by biglion In reply to
Quote Reply
Re: [Andy] onmouseover Javascript Error In reply to
Wink Thanks Andy! That worked perfectly.
Quote Reply
Re: [biglion] onmouseover Javascript Error In reply to
Glad to hear it :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!