Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
"javascript: var s = %22%s%22; self.location = ((%22%s%22 == s) ? %22http://www.perlmonks.org/%22 : (%22http://www.perlmonks.org/index.pl?node=%22 + s))" Not sure how many people actually use this, but those of you on Firefox would have noticed the above does not actually work correctly any more. It always goes to perlmonks home page and never does a search. It does work fine on Mozilla Seamonkey though. I finally traced this to a slight difference in how it works in Firefox and Seamonkey. Below code does seem to work on both. I had to split the %s into two strings in the comparison with variable s to stop firefox from trying to replace it. javascript: var s = "%s"; self.location = (("%" + "s" == s) ? "http://www.perlmonks.org/" : ("http://www.perlmonks.org/index.pl?node=" + s));A corresponding one for Perl documentation javascript: var s = "%s"; self.location = (("%" + "s" == s) ? "http://perldoc.perl.org/" : ("http://perldoc.perl.org/search.html?q=" + s));In reply to Re^2: Laziness, Lizards and Monks
by data64
|
|