Solved

onClick for exit and other stuff

Posted on 2001-08-07
4
638 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now