Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 31st, 2012  |  syntax: None  |  size: 0.41 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Follow the link from href as a callback
  2. $('a').click(function(e) {
  3.         savePage(previewPage);
  4.     });
  5.        
  6. $('a').click(function(e) {
  7.       var link = this;
  8.       savePage(previewPage, function() {
  9.           document.location = link.href;
  10.       });
  11.       return false;
  12. });
  13.        
  14. function savePage(previewPage, callback) {
  15.    ...
  16.    ...
  17.  
  18.    if(typeof callback !== "undefined") {
  19.       callback.call(null);
  20.    }
  21. }