Jump to content

Search the Community

Showing results for tags 'return'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. Hi, Im trying to run the showPic function without putting any JS into HTML(when i used onclick = showPic() return false, it worked fine). I added prepareGallery function for this reason and I cant get it working. I think I can see it changes the pics but link will be executed also. Anyone got an idea where I made the mistake? <body><h1>Snapshots</h1><ol id="links"><li><a href="benfica.jpg" title="benfica">Benfica</a></li><li><a href="yamaha.jpg" title="yamaha">Yamaha</a></li><li><a href="island.jpg" title="island">Island</a></li><li><a href="opossum.JPG" title="opossum">Opossum</a></li></ol><img id="placeholder" src="1.jpg" alt="my image gallery" /><p id="desc">Choose an image</p></body>function showPic(whichpic) {if (!document.getElementById("placeholder")) return false; var source = whichpic.getAttribute("href");var placeholder = document.getElementById("placeholder");placeholder.setAttribute("src",source);if (!document.getElementsById("desc")) return false;var titletext = whichpic.getAttribute("title");var desc = document.getElementById("desc"); desc.firstChild.nodeValue = titletext;return false;}function prepareGallery(){if (!document.getElementById || !document.getElementsByTagName) return false;var links = document.getElementById("links");var actLinks = links.getElementsByTagName("a");for (var i = 0; i < actLinks.length; i++){actLinks[i].onclick = function(){showPic(this);return false;}}}window.onload = prepareGallery;
  2. What's the difference between returning null (with no value) or return FALSE ? I'm a bit confused about which to choose... Can you give me the implementation of those two and explain the essential to me?
×
×
  • Create New...