Gossamer Forum
Home : General : Perl Programming :

Javascript on global ...

Quote Reply
Javascript on global ...
When put under java on the global category_info

onmouseover="window.status='$name'; return true;"
onmouseout="window.status='';"


global category_info

sub {
my $tag = shift;
my $table = $DB->table ('CatLinks');
my $sth = $table->select ( { LinkID => $tag->{ID} }, ['CategoryID'] );
my $catID = $sth->fetchrow();
my $cattable = $DB->table('Category');
my $sth2 = $cattable->select ( { ID => $catID }, ['Full_Name'] );
my $name = $sth2->fetchrow_array;
my $clean_name = $cattable->as_url($name);
my $url = "<a href=\"" . $CFG->{build_root_url} . "/" . $clean_name . '/' . $CFG->{build_index} . "\" onmouseover="window.status='$name'; return true;"
onmouseout="window.status='';"
>" . $name . "</a>";
return $url;
}

i had get this error message.

A fatal error has occured:

Unable to compile 'category_info'. Reason: syntax error at (eval 12) line 10, near ""\" onmouseover="window"
syntax error at (eval 12) line 11, near ""
onmouseout="window"

Please enable debugging in setup for more details.

Does anybody can teach me how to fix this problem? THANK
Quote Reply
Re: [PDK1999] Javascript on global ... In reply to
Try this can work

my $url = qq|<a href=" $CFG->{build_root_url} / $clean_name / $CFG->{build_index} onmouseover="window.status='$name'; return true;"
onmouseout="window.status='';> $name </a>|;

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Javascript on global ... In reply to
tandat :

Thank for your reply,

but it can't working... when i copy this then do it, it can't working and hidden the category_info on the link result........

... ^^'
Quote Reply
Re: [PDK1999] Javascript on global ... In reply to
Please could you explain further. Are any errors present?