Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

onClick for exit and other stuff

Posted on 2001-08-07
4
Medium Priority
?
658 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

879 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