Solved

onClick for exit and other stuff

Posted on 2001-08-07
4
635 Views
Last Modified: 2007-12-19
Am I using onClick the right way to use this button to close the browser? I have the rollovers OK, so I know I'm good to where I start onClick. I have to use the API calls that are there.

<A HREF="#" ONMOUSEOUT="MM_swapImgRestore()"
            ONMOUSEOVER="MM_swapImage('exit button','','images/exitcrseRd.gif',1)"><IMG
            NAME="exit button" BORDER="0" SRC="images/exitcrseRo.gif" WIDTH="70"
            HEIGHT="100" onMouseOver="MM_controlSound('play','document.CS995919757220','audio/idg_perc-intermed-280.wav')"
            onClick = function Exit(){
    API.LMSCommit();
    API.LMSFinish();
    setTimeout( "parent.self.close()", 1000 );</A>
0
Comment
Question by:jgla
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
coreyit earned 50 total points
ID: 6361448
what you want to do is pull the Exit() function out into the script area (where the MM_swapImg() and MM_swapImgRestore() functions are) and then have

onClick="Exit()"

so, somewhere you have:

----------
<script language="javascript" type="text/javascript">
    function Exit(){
       API.LMSCommit();
       API.LMSFinish();
       setTimeout( "parent.self.close()", 1000 );
    }

    // and other functions
</script>
----------

and your anchor tag is

----------
<A HREF="#" ONMOUSEOUT="MM_swapImgRestore()"
           ONMOUSEOVER="MM_swapImage('exit button','','images/exitcrseRd.gif',1)"><IMG
           NAME="exit button" BORDER="0" SRC="images/exitcrseRo.gif" WIDTH="70"
           HEIGHT="100" onMouseOver="MM_controlSound('play','document.CS995919757220','audio/idg_perc-intermed-280.wav')"
           onClick="Exit()"</A>
----------

-corey
0
 

Author Comment

by:jgla
ID: 6365191
Thanks. Would you be interested in reviewing a web page I'm doing and looking at the JS? I'm trying to copy script from an example provided to me by a Learning Management System company, and I'm a JS newbie. I would be very liberal with points if you are interested.

Data: the web page sits in an invisible frameset that holds an API object. The web page makes function calls to the API to do things like get student name, set bookmarks, etc.

Just a review to see if I did anything real dumb would be cool.

0
 
LVL 2

Expert Comment

by:coreyit
ID: 6367431
I'm glad this step worked for you and I would be happy to help out more if you like.

-corey
0
 

Author Comment

by:jgla
ID: 6369120
Great - I'll post another question...
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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

759 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

17 Experts available now in Live!

Get 1:1 Help Now