Click here to Skip to main content
15,889,527 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Cross browser compatibility Pin
Jellali Tarek7-Mar-14 4:42
Jellali Tarek7-Mar-14 4:42 
QuestionSimple computing machine Pin
Member 1062982927-Feb-14 2:07
Member 1062982927-Feb-14 2:07 
SuggestionRe: Simple computing machine Pin
thatraja27-Feb-14 3:11
professionalthatraja27-Feb-14 3:11 
QuestionRe: Simple computing machine Pin
ZurdoDev27-Feb-14 4:04
professionalZurdoDev27-Feb-14 4:04 
AnswerRe: Simple computing machine Pin
Member 1062982927-Feb-14 13:23
Member 1062982927-Feb-14 13:23 
QuestionRe: Simple computing machine Pin
ZurdoDev27-Feb-14 13:38
professionalZurdoDev27-Feb-14 13:38 
QuestionRe: Simple computing machine Pin
Richard MacCutchan27-Feb-14 22:20
mveRichard MacCutchan27-Feb-14 22:20 
QuestionProblem using onbeforeunload in JQuery or Javascript Pin
Vimalsoft(Pty) Ltd26-Feb-14 3:14
professionalVimalsoft(Pty) Ltd26-Feb-14 3:14 
Good Day All

i am opening a Popup and i want to bind the "onbeforeunload" to the popup that if someone clicks on the close button in the window or close button in the page , the event should fire a javascript function that is on the page that opened the popup.
JavaScript
function ProcessPayment(Downloadurl)
     {


         var url = "http://XXXX.com/cccc_ccccc/2938dc870cd394?tc_id=210&tc_45f=50.0&sig=fc5cbfe44230";
         var popupWindow = window;

popupWindow.onbeforeunload = function () {
             if (Downloadurl != "") {
                 $.fileDownload(Downloadurl)
               .done(function () { alert('File download a success!'); })
               .fail(function () { alert('File download failed!'); });
             }
             else {
                 alert("No URL found");
             }
         }

         //open the Popup window
         popupWindow.open(url, 'popUpWindow', 'height=400,width=500,left=10,top=10,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes')
          //bind the event so that when a user close the windown , we download the file


when i try this nothing happens the event does not get work and no error in the browsers console

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com

SuggestionOff-Topic Pin
Nicholas Marty26-Feb-14 4:00
professionalNicholas Marty26-Feb-14 4:00 
GeneralRe: Off-Topic Pin
Vimalsoft(Pty) Ltd26-Feb-14 4:51
professionalVimalsoft(Pty) Ltd26-Feb-14 4:51 
GeneralRe: Off-Topic Pin
ZurdoDev26-Feb-14 4:53
professionalZurdoDev26-Feb-14 4:53 
AnswerRe: Problem using onbeforeunload in JQuery or Javascript Pin
Kornfeld Eliyahu Peter26-Feb-14 4:34
professionalKornfeld Eliyahu Peter26-Feb-14 4:34 
GeneralRe: Problem using onbeforeunload in JQuery or Javascript Pin
Vimalsoft(Pty) Ltd26-Feb-14 4:58
professionalVimalsoft(Pty) Ltd26-Feb-14 4:58 
AnswerRe: Problem using onbeforeunload in JQuery or Javascript Pin
ZurdoDev26-Feb-14 4:54
professionalZurdoDev26-Feb-14 4:54 
AnswerRe: Problem using onbeforeunload in JQuery or Javascript Pin
Abhishek_RK2-Mar-14 20:41
Abhishek_RK2-Mar-14 20:41 
QuestionOpen form page from network drive and save on the network drive Pin
abmanish7125-Feb-14 7:11
abmanish7125-Feb-14 7:11 
SuggestionRe: Open form page from network drive and save on the network drive Pin
Richard Deeming25-Feb-14 7:32
mveRichard Deeming25-Feb-14 7:32 
Questionwatermark val coming in IE11 Pin
nitin_ion24-Feb-14 3:04
nitin_ion24-Feb-14 3:04 
AnswerRe: watermark val coming in IE11 Pin
Kornfeld Eliyahu Peter25-Feb-14 6:10
professionalKornfeld Eliyahu Peter25-Feb-14 6:10 
GeneralRe: watermark val coming in IE11 Pin
nitin_ion25-Feb-14 15:48
nitin_ion25-Feb-14 15:48 
QuestionObfuscated script (likely malware) Pin
Bernhard Hiller23-Feb-14 4:41
Bernhard Hiller23-Feb-14 4:41 
AnswerRe: Obfuscated script (likely malware) Pin
Kornfeld Eliyahu Peter24-Feb-14 4:12
professionalKornfeld Eliyahu Peter24-Feb-14 4:12 
GeneralRe: Obfuscated script (likely malware) Pin
Bernhard Hiller24-Feb-14 20:34
Bernhard Hiller24-Feb-14 20:34 
GeneralRe: Obfuscated script (likely malware) Pin
Nicholas Marty25-Feb-14 4:17
professionalNicholas Marty25-Feb-14 4:17 
GeneralRe: Obfuscated script (likely malware) Pin
Bernhard Hiller25-Feb-14 20:51
Bernhard Hiller25-Feb-14 20:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.