Solved

onClick for exit and other stuff

Posted on 2001-08-07
4
646 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Timer on div 5 24
HTML auto refresh to another site 4 30
Two decimal 5 29
Why am I getting ReferenceError:  boxes is not defined error 5 10
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 …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

733 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