Reply to Re: Need help creating a "Click absolutely ANYWHERE on this page" link for an HTML page with no content

Your name:

Reply:


Posted by pcx99 on 02/08/07 15:59

STILL LEARNING wrote:
> On Feb 8, 6:36 am, pcx99 <x...@x.com> wrote:
>> document.onclick=function () {
>> document.location.href="http://someurl.com"; }
>
> pcx99, forgive my ignorance but . . . what is this? Javascript? It's
> quite elegant and I like it, but I'm not sure where it would go or if
> it might be fussy (eg cross-browser compatible).
>
> Very elegant, and this is easily the best solution -- both for
> simplicity and size -- but only if it is not fussy. Could you
> elaborate a bit? Does this go BEFORE the </HEAD> -or- AFTER the
> <BODY> tag? Thank you pcx99. :)
>
> SL'in
>

Yes this is javascript. It can go anywhere on your page. Here's the
full text you'll need to insert.

<script type="text/javascript">
document.onclick=function ()
{document.location.href="http://someurl.com";}
</script>

This will over-ride any other links you would have on the page. If the
user clicks anywhere, regardless of where or what he or she clicks it
will call this script (unless the user has javascript disabled, in which
case nothing would happen).

Sorry for not being clearer in the original post. I had not noticed it
was cross-linked.



--
http://www.hunlock.com -- Musings in Javascript, CSS.
$FA

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация