Calling function through onload

Calling function through onload

Hi everybody,

I'm playing with a modal Dialog of ericmartin (simplemodal) which I found at this url: http://www.ericmmartin.com/projects/simplemodal-demos/

It's called "Confirm override". This function is called through a click on the button or on the link. Now I want to call this function onload I dont' have really a clue, how to manipulate the current script to make the correct changes.

Imho this is the code snippet, which calls the popup through a click.

  1. jQuery(function ($) {
  2. $('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
  3. e.preventDefault();

  4. // example of calling the confirm function
  5. // you must use a callback function to perform the "yes" action
  6. confirm("Sind Sie sicher?", function () {
  7. window.location.href = 'http://www.google.com';
  8. }
  9. );
  10. });
  11. });
It would be great if you could give me a hint, how to make the popup via "onload".