[Javascript] Returning a Question

Hassan Schroeder hassan at webtuitive.com
Thu Aug 11 14:14:02 CDT 2005


Triche Osborne wrote:
> Scott's problem and its solution reminded me of a question I've been 
> wanting to ask re: the following:
> 
> <a onclick="return(showPic(this))" href="image.jpg" />
> 
> What, exactly, is return doing in this instance? The function has no 
> explicit return value

Huh? The message I was responding to had this:

> since it worked in the script I originally started with
> function showPic (whichpic) {
>     if (document.getElementById) {
>         document.getElementById('placeholder').src = whichpic.href;
>         return false;
>         } else {
>         return true;
>     }
> } 

:: which, as you see, *does* have explicit return values...

-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.





More information about the Javascript mailing list