Solved

what is "return true"?

Posted on 1998-08-30
3
152 Views
Last Modified: 2010-04-09
i was told that i need "return true"
with this rollover
but it seems to be working well...
do i really need it?
what does it do?


<A HREF="aa.html"
ONMOUSEOVER ="document.bgColor='#010470'" ;"
onMouseOut="document.bgColor='#1BA6EF'">
<img SRC="images/qalw.gif"
 border=0></A>
0
Comment
Question by:asacui
3 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 0 total points
ID: 1837211
It's not necesary to return true when you are only changing comething like the bgColor or swapping an image, etc.  However if you want to change the window.status property (the status bar message) you need to return true in order to prevent the browser from dispolaying the url of the link in the status bar.  In this case you probably want the url to be displayed and thus should NOT return true.

-Josh
0
 

Author Comment

by:asacui
ID: 1837212
thankyou
0
 
LVL 4

Expert Comment

by:martinag
ID: 1837213
By returning true you tell the browser that you have handled the event (MouseOver) and that you do not want the browser to do what it usually does (displaying URL).

Martin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now