Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

onClick for exit and other stuff

Posted on 2001-08-07
4
Medium Priority
?
654 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 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 discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

715 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