[Proto-Scripty] Re: text from php flashes by!?
On Jul 11, 3:01 pm, "T.J. Crowder" wrote: > > Is it possible to remove the 'updateDiv', line and then only one > > would be needed? There is no need for a returned message after the > > email has been sent, only after the data has gone to mysql. > > In that case, change it to an Ajax.Request rather than an > Ajax.Updater. OK thanks Geoff > > -- T.J. > > On Jul 11, 1:14 pm, geoffcox75 wrote: > > > On Jul 11, 12:47 pm, geoffcox75 wrote: > > > > On Jul 11, 12:36 pm, "T.J. Crowder" wrote: > > > > > Hi Geoff, > > > > > My guess is that it's caused by something outside of the code you've > > > > quoted. For instance, what's _calling_ that code? Given where the > > > I have found the solution in that a previous Ajax Updater was used to > > run some php which sent an email and it and the mysql Ajax were using > > the same for any returned message from the php. By creating a > > second for the mysql code, the returned message stays on the > > screen. > > > The code for sending the email is > > > new Ajax.Updater( > > 'updateDiv', > > 'fv-c1-arrays4-send-comment-minus-wm.php', > > { > > asynchronous:true, > > method:'post', > > parameters: params > > } > > ); > > > Is it possible to remove the 'updateDiv', line and then only one > > would be needed? There is no need for a returned message after the > > email has been sent, only after the data has gone to mysql. > > > Cheers, > > > Geoff > > > > > alert is (and as Alex pointed out, an alert is basically a breakpoint > > > > -- all JavaScript execution on the page is completely suspended while > > > > the alert is showing), my guess is that this code is getting called > > > > twice -- first when flag10 is true, then again afterwards when flag10 > > > > OK - thanks for that thought - will check further. > > > > Cheers > > > > Geoff > > > > > is false and flaglast is true. The alert holds back the second > > > > update, and so you see the result of the first one. Something along > > > > those lines. > > > > > FWIW, > > > > -- > > > > T.J. Crowder > > > > tj / crowder software / com > > > > Independent Software Engineer, consulting services available > > > > > On Jul 11, 12:12 pm, geoffcox75 wrote: > > > > > > On Jul 11, 10:46 am, "Alex McAuley" > > > > > wrote: > > > > > > > Its doing the second ajax updater (the one with the alert in it) > > > > > > regardless > > > > > > of the flag. It is showing the text up because you are in effect > > > > > > putting a > > > > > > break point in it with the alert(); > > > > > > > I would look at where the "flaglast" variable is set and make sure > > > > > > it is > > > > > > false in the first instance. You might also want to typecast it to > > > > > > make > > > > > > Alex, > > > > > > I have tried various options but the returned text still flashes by! > > > > > > I have checked that at the start of the function with the code I have > > > > > shonw in it, flag10 is false and flaglast is true and indeed the right > > > > > code is used as the right values get into mysql (i.e. those using the > > > > > second set of Ajax code). > > > > > > So I still don't see why the text from the php flashes before my eyes! > > > > > > I must be still missing some thing! > > > > > > Cheers > > > > > > Geoff > > > > > > > sure its boolean: > > > > > > var flaglast=false; > > > > > > > Ajax code {.} > > > > > > // Notice the 3 equals) > > > > > > if(flaglast===true) { > > > > > > do something > > > > > > > } > > > > > > > or you could remove the else if and use a switch or just "ifs" > > > > > > > if(flag10===true) { > > > > > > .. do stuff} > > > > > > > if(flaglast===true) { > > > > > > do some other stuff > > > > > > > } else { > > > > > > >
[Proto-Scripty] Re: text from php flashes by!?
> Is it possible to remove the 'updateDiv', line and then only one > would be needed? There is no need for a returned message after the > email has been sent, only after the data has gone to mysql. In that case, change it to an Ajax.Request rather than an Ajax.Updater. -- T.J. On Jul 11, 1:14 pm, geoffcox75 wrote: > On Jul 11, 12:47 pm, geoffcox75 wrote: > > > On Jul 11, 12:36 pm, "T.J. Crowder" wrote: > > > > Hi Geoff, > > > > My guess is that it's caused by something outside of the code you've > > > quoted. For instance, what's _calling_ that code? Given where the > > I have found the solution in that a previous Ajax Updater was used to > run some php which sent an email and it and the mysql Ajax were using > the same for any returned message from the php. By creating a > second for the mysql code, the returned message stays on the > screen. > > The code for sending the email is > > new Ajax.Updater( > 'updateDiv', > 'fv-c1-arrays4-send-comment-minus-wm.php', > { > asynchronous:true, > method:'post', > parameters: params > } > ); > > Is it possible to remove the 'updateDiv', line and then only one > would be needed? There is no need for a returned message after the > email has been sent, only after the data has gone to mysql. > > Cheers, > > Geoff > > > > > > alert is (and as Alex pointed out, an alert is basically a breakpoint > > > -- all JavaScript execution on the page is completely suspended while > > > the alert is showing), my guess is that this code is getting called > > > twice -- first when flag10 is true, then again afterwards when flag10 > > > OK - thanks for that thought - will check further. > > > Cheers > > > Geoff > > > > is false and flaglast is true. The alert holds back the second > > > update, and so you see the result of the first one. Something along > > > those lines. > > > > FWIW, > > > -- > > > T.J. Crowder > > > tj / crowder software / com > > > Independent Software Engineer, consulting services available > > > > On Jul 11, 12:12 pm, geoffcox75 wrote: > > > > > On Jul 11, 10:46 am, "Alex McAuley" > > > > wrote: > > > > > > Its doing the second ajax updater (the one with the alert in it) > > > > > regardless > > > > > of the flag. It is showing the text up because you are in effect > > > > > putting a > > > > > break point in it with the alert(); > > > > > > I would look at where the "flaglast" variable is set and make sure it > > > > > is > > > > > false in the first instance. You might also want to typecast it to > > > > > make > > > > > Alex, > > > > > I have tried various options but the returned text still flashes by! > > > > > I have checked that at the start of the function with the code I have > > > > shonw in it, flag10 is false and flaglast is true and indeed the right > > > > code is used as the right values get into mysql (i.e. those using the > > > > second set of Ajax code). > > > > > So I still don't see why the text from the php flashes before my eyes! > > > > > I must be still missing some thing! > > > > > Cheers > > > > > Geoff > > > > > > sure its boolean: > > > > > var flaglast=false; > > > > > > Ajax code {.} > > > > > // Notice the 3 equals) > > > > > if(flaglast===true) { > > > > > do something > > > > > > } > > > > > > or you could remove the else if and use a switch or just "ifs" > > > > > > if(flag10===true) { > > > > > .. do stuff} > > > > > > if(flaglast===true) { > > > > > do some other stuff > > > > > > } else { > > > > > > alert("Oops something went wrong"); > > > > > > } > > > > > > HTH > > > > > > Alex > > > > > > - Original Message - > > > > > From: "geoffcox75" > > > > > To: "Prototype & script.aculo.us" > > > > > > > > > > Sent: Saturday, July 11, 2009 10:15 AM > > > > > Subject: [Proto-Scripty] Re:
[Proto-Scripty] Re: text from php flashes by!?
sorry the error messages have gone - must have been a typo. Geoff On Jul 11, 1:34 pm, geoffcox75 wrote: > Hello, > > the second keeps the php message on the screen but I now get an > error message re prototype 1.6.0.3, > > in Firefox it is this.url.match is not a function > > in Chrome has no method match > > both refer to line 1332 in the prototype js file. > > Any idea how to solve this one? > > Cheers > > Geoff > > On Jul 11, 12:47 pm, geoffcox75 wrote: > > > On Jul 11, 12:36 pm, "T.J. Crowder" wrote: > > > > Hi Geoff, > > > > My guess is that it's caused by something outside of the code you've > > > quoted. For instance, what's _calling_ that code? Given where the > > > alert is (and as Alex pointed out, an alert is basically a breakpoint > > > -- all JavaScript execution on the page is completely suspended while > > > the alert is showing), my guess is that this code is getting called > > > twice -- first when flag10 is true, then again afterwards when flag10 > > > OK - thanks for that thought - will check further. > > > Cheers > > > Geoff > > > > is false and flaglast is true. The alert holds back the second > > > update, and so you see the result of the first one. Something along > > > those lines. > > > > FWIW, > > > -- > > > T.J. Crowder > > > tj / crowder software / com > > > Independent Software Engineer, consulting services available > > > > On Jul 11, 12:12 pm, geoffcox75 wrote: > > > > > On Jul 11, 10:46 am, "Alex McAuley" > > > > wrote: > > > > > > Its doing the second ajax updater (the one with the alert in it) > > > > > regardless > > > > > of the flag. It is showing the text up because you are in effect > > > > > putting a > > > > > break point in it with the alert(); > > > > > > I would look at where the "flaglast" variable is set and make sure it > > > > > is > > > > > false in the first instance. You might also want to typecast it to > > > > > make > > > > > Alex, > > > > > I have tried various options but the returned text still flashes by! > > > > > I have checked that at the start of the function with the code I have > > > > shonw in it, flag10 is false and flaglast is true and indeed the right > > > > code is used as the right values get into mysql (i.e. those using the > > > > second set of Ajax code). > > > > > So I still don't see why the text from the php flashes before my eyes! > > > > > I must be still missing some thing! > > > > > Cheers > > > > > Geoff > > > > > > sure its boolean: > > > > > var flaglast=false; > > > > > > Ajax code {.........} > > > > > // Notice the 3 equals) > > > > > if(flaglast===true) { > > > > > do something > > > > > > } > > > > > > or you could remove the else if and use a switch or just "ifs" > > > > > > if(flag10===true) { > > > > > .. do stuff} > > > > > > if(flaglast===true) { > > > > > do some other stuff > > > > > > } else { > > > > > > alert("Oops something went wrong"); > > > > > > } > > > > > > HTH > > > > > > Alex > > > > > > - Original Message - > > > > > From: "geoffcox75" > > > > > To: "Prototype & script.aculo.us" > > > > > > > > > > Sent: Saturday, July 11, 2009 10:15 AM > > > > > Subject: [Proto-Scripty] Re: text from php flashes by!? > > > > > > Alex, > > > > > > It's just that wheb flaglast is true the code > > > > > > new Ajax.Updater( > > > > > 'updateDiv', > > > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > > > { > > > > > asynchronous:true, > > > > > method:'post', > > > > > parameters: params > > > > > } > > > > > ); > > > > > > works fine and updates the mysql database using the php file but the > > > > > text message coming back from the php file i
[Proto-Scripty] Re: text from php flashes by!?
Hello, the second keeps the php message on the screen but I now get an error message re prototype 1.6.0.3, in Firefox it is this.url.match is not a function in Chrome has no method match both refer to line 1332 in the prototype js file. Any idea how to solve this one? Cheers Geoff On Jul 11, 12:47 pm, geoffcox75 wrote: > On Jul 11, 12:36 pm, "T.J. Crowder" wrote: > > > Hi Geoff, > > > My guess is that it's caused by something outside of the code you've > > quoted. For instance, what's _calling_ that code? Given where the > > alert is (and as Alex pointed out, an alert is basically a breakpoint > > -- all JavaScript execution on the page is completely suspended while > > the alert is showing), my guess is that this code is getting called > > twice -- first when flag10 is true, then again afterwards when flag10 > > OK - thanks for that thought - will check further. > > Cheers > > Geoff > > > is false and flaglast is true. The alert holds back the second > > update, and so you see the result of the first one. Something along > > those lines. > > > FWIW, > > -- > > T.J. Crowder > > tj / crowder software / com > > Independent Software Engineer, consulting services available > > > On Jul 11, 12:12 pm, geoffcox75 wrote: > > > > On Jul 11, 10:46 am, "Alex McAuley" > > > wrote: > > > > > Its doing the second ajax updater (the one with the alert in it) > > > > regardless > > > > of the flag. It is showing the text up because you are in effect > > > > putting a > > > > break point in it with the alert(); > > > > > I would look at where the "flaglast" variable is set and make sure it is > > > > false in the first instance. You might also want to typecast it to make > > > > Alex, > > > > I have tried various options but the returned text still flashes by! > > > > I have checked that at the start of the function with the code I have > > > shonw in it, flag10 is false and flaglast is true and indeed the right > > > code is used as the right values get into mysql (i.e. those using the > > > second set of Ajax code). > > > > So I still don't see why the text from the php flashes before my eyes! > > > > I must be still missing some thing! > > > > Cheers > > > > Geoff > > > > > sure its boolean: > > > > var flaglast=false; > > > > > Ajax code {.} > > > > // Notice the 3 equals) > > > > if(flaglast===true) { > > > > do something > > > > > } > > > > > or you could remove the else if and use a switch or just "ifs" > > > > > if(flag10===true) { > > > > .. do stuff} > > > > > if(flaglast===true) { > > > > do some other stuff > > > > > } else { > > > > > alert("Oops something went wrong"); > > > > > } > > > > > HTH > > > > > Alex > > > > > - Original Message - > > > > From: "geoffcox75" > > > > To: "Prototype & script.aculo.us" > > > > > > > > Sent: Saturday, July 11, 2009 10:15 AM > > > > Subject: [Proto-Scripty] Re: text from php flashes by!? > > > > > Alex, > > > > > It's just that wheb flaglast is true the code > > > > > new Ajax.Updater( > > > > 'updateDiv', > > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > > { > > > > asynchronous:true, > > > > method:'post', > > > > parameters: params > > > > } > > > > ); > > > > > works fine and updates the mysql database using the php file but the > > > > text message coming back from the php file into the updateDiv > > > > only stays on the screen for a split second unless I add the alert! Of > > > > course I do not want the alert but by chance I found that having the > > > > alert for some reason causes the message to stay on the screen ... > > > > > Cheers > > > > > Geoff > > > > > On Jul 11, 9:57 am, "Alex McAuley" > > > > wrote: > > > > > Can you explain it a bit better as i cant understand what you are > > > > > asking ! > > > > > > Alex > > >
[Proto-Scripty] Re: text from php flashes by!?
On Jul 11, 12:47 pm, geoffcox75 wrote: > On Jul 11, 12:36 pm, "T.J. Crowder" wrote: > > > Hi Geoff, > > > My guess is that it's caused by something outside of the code you've > > quoted. For instance, what's _calling_ that code? Given where the I have found the solution in that a previous Ajax Updater was used to run some php which sent an email and it and the mysql Ajax were using the same for any returned message from the php. By creating a second for the mysql code, the returned message stays on the screen. The code for sending the email is new Ajax.Updater( 'updateDiv', 'fv-c1-arrays4-send-comment-minus-wm.php', { asynchronous:true, method:'post', parameters: params } ); Is it possible to remove the 'updateDiv', line and then only one would be needed? There is no need for a returned message after the email has been sent, only after the data has gone to mysql. Cheers, Geoff > > alert is (and as Alex pointed out, an alert is basically a breakpoint > > -- all JavaScript execution on the page is completely suspended while > > the alert is showing), my guess is that this code is getting called > > twice -- first when flag10 is true, then again afterwards when flag10 > > OK - thanks for that thought - will check further. > > Cheers > > Geoff > > > is false and flaglast is true. The alert holds back the second > > update, and so you see the result of the first one. Something along > > those lines. > > > FWIW, > > -- > > T.J. Crowder > > tj / crowder software / com > > Independent Software Engineer, consulting services available > > > On Jul 11, 12:12 pm, geoffcox75 wrote: > > > > On Jul 11, 10:46 am, "Alex McAuley" > > > wrote: > > > > > Its doing the second ajax updater (the one with the alert in it) > > > > regardless > > > > of the flag. It is showing the text up because you are in effect > > > > putting a > > > > break point in it with the alert(); > > > > > I would look at where the "flaglast" variable is set and make sure it is > > > > false in the first instance. You might also want to typecast it to make > > > > Alex, > > > > I have tried various options but the returned text still flashes by! > > > > I have checked that at the start of the function with the code I have > > > shonw in it, flag10 is false and flaglast is true and indeed the right > > > code is used as the right values get into mysql (i.e. those using the > > > second set of Ajax code). > > > > So I still don't see why the text from the php flashes before my eyes! > > > > I must be still missing some thing! > > > > Cheers > > > > Geoff > > > > > sure its boolean: > > > > var flaglast=false; > > > > > Ajax code {.} > > > > // Notice the 3 equals) > > > > if(flaglast===true) { > > > > do something > > > > > } > > > > > or you could remove the else if and use a switch or just "ifs" > > > > > if(flag10===true) { > > > > .. do stuff} > > > > > if(flaglast===true) { > > > > do some other stuff > > > > > } else { > > > > > alert("Oops something went wrong"); > > > > > } > > > > > HTH > > > > > Alex > > > > > - Original Message - > > > > From: "geoffcox75" > > > > To: "Prototype & script.aculo.us" > > > > > > > > Sent: Saturday, July 11, 2009 10:15 AM > > > > Subject: [Proto-Scripty] Re: text from php flashes by!? > > > > > Alex, > > > > > It's just that wheb flaglast is true the code > > > > > new Ajax.Updater( > > > > 'updateDiv', > > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > > { > > > > asynchronous:true, > > > > method:'post', > > > > parameters: params > > > > } > > > > ); > > > > > works fine and updates the mysql database using the php file but the > > > > text message coming back from the php file into the updateDiv > > > > only stays on the screen for a split second unless I add the alert! Of > > > > course I
[Proto-Scripty] Re: text from php flashes by!?
On Jul 11, 12:36 pm, "T.J. Crowder" wrote: > Hi Geoff, > > My guess is that it's caused by something outside of the code you've > quoted. For instance, what's _calling_ that code? Given where the > alert is (and as Alex pointed out, an alert is basically a breakpoint > -- all JavaScript execution on the page is completely suspended while > the alert is showing), my guess is that this code is getting called > twice -- first when flag10 is true, then again afterwards when flag10 OK - thanks for that thought - will check further. Cheers Geoff > is false and flaglast is true. The alert holds back the second > update, and so you see the result of the first one. Something along > those lines. > > FWIW, > -- > T.J. Crowder > tj / crowder software / com > Independent Software Engineer, consulting services available > > On Jul 11, 12:12 pm, geoffcox75 wrote: > > > On Jul 11, 10:46 am, "Alex McAuley" > > wrote: > > > > Its doing the second ajax updater (the one with the alert in it) > > > regardless > > > of the flag. It is showing the text up because you are in effect putting a > > > break point in it with the alert(); > > > > I would look at where the "flaglast" variable is set and make sure it is > > > false in the first instance. You might also want to typecast it to make > > > Alex, > > > I have tried various options but the returned text still flashes by! > > > I have checked that at the start of the function with the code I have > > shonw in it, flag10 is false and flaglast is true and indeed the right > > code is used as the right values get into mysql (i.e. those using the > > second set of Ajax code). > > > So I still don't see why the text from the php flashes before my eyes! > > > I must be still missing some thing! > > > Cheers > > > Geoff > > > > sure its boolean: > > > var flaglast=false; > > > > Ajax code {.} > > > // Notice the 3 equals) > > > if(flaglast===true) { > > > do something > > > > } > > > > or you could remove the else if and use a switch or just "ifs" > > > > if(flag10===true) { > > > .. do stuff} > > > > if(flaglast===true) { > > > do some other stuff > > > > } else { > > > > alert("Oops something went wrong"); > > > > } > > > > HTH > > > > Alex > > > > - Original Message - > > > From: "geoffcox75" > > > To: "Prototype & script.aculo.us" > > > > > > Sent: Saturday, July 11, 2009 10:15 AM > > > Subject: [Proto-Scripty] Re: text from php flashes by!? > > > > Alex, > > > > It's just that wheb flaglast is true the code > > > > new Ajax.Updater( > > > 'updateDiv', > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > { > > > asynchronous:true, > > > method:'post', > > > parameters: params > > > } > > > ); > > > > works fine and updates the mysql database using the php file but the > > > text message coming back from the php file into the updateDiv > > > only stays on the screen for a split second unless I add the alert! Of > > > course I do not want the alert but by chance I found that having the > > > alert for some reason causes the message to stay on the screen ... > > > > Cheers > > > > Geoff > > > > On Jul 11, 9:57 am, "Alex McAuley" > > > wrote: > > > > Can you explain it a bit better as i cant understand what you are > > > > asking ! > > > > > Alex > > > > > - Original Message - > > > > From: "geoffcox" > > > > To: "Prototype & script.aculo.us" > > > > > > > > Sent: Saturday, July 11, 2009 9:53 AM > > > > Subject: [Proto-Scripty] text from php flashes by!? > > > > > > Hello, > > > > > > Can anyone see why unless I have > > > > > > alert("press OK"); or some other alert message, > > > > > > when flaglast is true, the text coming from the php script only stays > > > > > on the screen for a split second! > > > > > > Thanks > > > > > > Geoff > > > > > > if (flag10 == true) { > > > &
[Proto-Scripty] Re: text from php flashes by!?
Hi Geoff, My guess is that it's caused by something outside of the code you've quoted. For instance, what's _calling_ that code? Given where the alert is (and as Alex pointed out, an alert is basically a breakpoint -- all JavaScript execution on the page is completely suspended while the alert is showing), my guess is that this code is getting called twice -- first when flag10 is true, then again afterwards when flag10 is false and flaglast is true. The alert holds back the second update, and so you see the result of the first one. Something along those lines. FWIW, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jul 11, 12:12 pm, geoffcox75 wrote: > On Jul 11, 10:46 am, "Alex McAuley" > wrote: > > > Its doing the second ajax updater (the one with the alert in it) regardless > > of the flag. It is showing the text up because you are in effect putting a > > break point in it with the alert(); > > > I would look at where the "flaglast" variable is set and make sure it is > > false in the first instance. You might also want to typecast it to make > > Alex, > > I have tried various options but the returned text still flashes by! > > I have checked that at the start of the function with the code I have > shonw in it, flag10 is false and flaglast is true and indeed the right > code is used as the right values get into mysql (i.e. those using the > second set of Ajax code). > > So I still don't see why the text from the php flashes before my eyes! > > I must be still missing some thing! > > Cheers > > Geoff > > > > > sure its boolean: > > var flaglast=false; > > > Ajax code {.} > > // Notice the 3 equals) > > if(flaglast===true) { > > do something > > > } > > > or you could remove the else if and use a switch or just "ifs" > > > if(flag10===true) { > > .. do stuff} > > > if(flaglast===true) { > > do some other stuff > > > } else { > > > alert("Oops something went wrong"); > > > } > > > HTH > > > Alex > > > - Original Message - > > From: "geoffcox75" > > To: "Prototype & script.aculo.us" > > Sent: Saturday, July 11, 2009 10:15 AM > > Subject: [Proto-Scripty] Re: text from php flashes by!? > > > Alex, > > > It's just that wheb flaglast is true the code > > > new Ajax.Updater( > > 'updateDiv', > > 'fv-c1-arrays4-mysql-minus-wm.php', > > { > > asynchronous:true, > > method:'post', > > parameters: params > > } > > ); > > > works fine and updates the mysql database using the php file but the > > text message coming back from the php file into the updateDiv > > only stays on the screen for a split second unless I add the alert! Of > > course I do not want the alert but by chance I found that having the > > alert for some reason causes the message to stay on the screen ... > > > Cheers > > > Geoff > > > On Jul 11, 9:57 am, "Alex McAuley" > > wrote: > > > Can you explain it a bit better as i cant understand what you are asking ! > > > > Alex > > > > - Original Message - > > > From: "geoffcox" > > > To: "Prototype & script.aculo.us" > > > > > > Sent: Saturday, July 11, 2009 9:53 AM > > > Subject: [Proto-Scripty] text from php flashes by!? > > > > > Hello, > > > > > Can anyone see why unless I have > > > > > alert("press OK"); or some other alert message, > > > > > when flaglast is true, the text coming from the php script only stays > > > > on the screen for a split second! > > > > > Thanks > > > > > Geoff > > > > > if (flag10 == true) { > > > > new Ajax.Updater( > > > > 'updateDiv', > > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > > { > > > > asynchronous:true, > > > > method:'post', > > > > parameters: params > > > > } > > > > ); > > > > resultsSaved = true; > > > > flag10 = false; > > > > > } else if (flaglast == true) { > > > > alert("press OK"); > > > > new Ajax.Updater( > > > > 'updateDiv', > > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > > { > > > > asynchronous:true, > > > > method:'post', > > > > parameters: params > > > > } > > > > ); > > > > resultsSaved = true; > > > > flaglast = false; > > > > } else { > > > > alert("oops"); > > > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: text from php flashes by!?
On Jul 11, 10:46 am, "Alex McAuley" wrote: > Its doing the second ajax updater (the one with the alert in it) regardless > of the flag. It is showing the text up because you are in effect putting a > break point in it with the alert(); > > I would look at where the "flaglast" variable is set and make sure it is > false in the first instance. You might also want to typecast it to make Alex, I have tried various options but the returned text still flashes by! I have checked that at the start of the function with the code I have shonw in it, flag10 is false and flaglast is true and indeed the right code is used as the right values get into mysql (i.e. those using the second set of Ajax code). So I still don't see why the text from the php flashes before my eyes! I must be still missing some thing! Cheers Geoff > sure its boolean: > var flaglast=false; > > Ajax code {.} > // Notice the 3 equals) > if(flaglast===true) { > do something > > } > > or you could remove the else if and use a switch or just "ifs" > > if(flag10===true) { > .. do stuff} > > if(flaglast===true) { > do some other stuff > > } else { > > alert("Oops something went wrong"); > > } > > HTH > > Alex > > - Original Message - > From: "geoffcox75" > To: "Prototype & script.aculo.us" > Sent: Saturday, July 11, 2009 10:15 AM > Subject: [Proto-Scripty] Re: text from php flashes by!? > > Alex, > > It's just that wheb flaglast is true the code > > new Ajax.Updater( > 'updateDiv', > 'fv-c1-arrays4-mysql-minus-wm.php', > { > asynchronous:true, > method:'post', > parameters: params > } > ); > > works fine and updates the mysql database using the php file but the > text message coming back from the php file into the updateDiv > only stays on the screen for a split second unless I add the alert! Of > course I do not want the alert but by chance I found that having the > alert for some reason causes the message to stay on the screen ... > > Cheers > > Geoff > > On Jul 11, 9:57 am, "Alex McAuley" > wrote: > > Can you explain it a bit better as i cant understand what you are asking ! > > > Alex > > > - Original Message - > > From: "geoffcox" > > To: "Prototype & script.aculo.us" > > > > Sent: Saturday, July 11, 2009 9:53 AM > > Subject: [Proto-Scripty] text from php flashes by!? > > > > Hello, > > > > Can anyone see why unless I have > > > > alert("press OK"); or some other alert message, > > > > when flaglast is true, the text coming from the php script only stays > > > on the screen for a split second! > > > > Thanks > > > > Geoff > > > > if (flag10 == true) { > > > new Ajax.Updater( > > > 'updateDiv', > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > { > > > asynchronous:true, > > > method:'post', > > > parameters: params > > > } > > > ); > > > resultsSaved = true; > > > flag10 = false; > > > > } else if (flaglast == true) { > > > alert("press OK"); > > > new Ajax.Updater( > > > 'updateDiv', > > > 'fv-c1-arrays4-mysql-minus-wm.php', > > > { > > > asynchronous:true, > > > method:'post', > > > parameters: params > > > } > > > ); > > > resultsSaved = true; > > > flaglast = false; > > > } else { > > > alert("oops"); > > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: text from php flashes by!?
Its doing the second ajax updater (the one with the alert in it) regardless of the flag. It is showing the text up because you are in effect putting a break point in it with the alert(); I would look at where the "flaglast" variable is set and make sure it is false in the first instance. You might also want to typecast it to make sure its boolean: var flaglast=false; Ajax code {.} // Notice the 3 equals) if(flaglast===true) { do something } or you could remove the else if and use a switch or just "ifs" if(flag10===true) { .. do stuff } if(flaglast===true) { do some other stuff } else { alert("Oops something went wrong"); } HTH Alex - Original Message - From: "geoffcox75" To: "Prototype & script.aculo.us" Sent: Saturday, July 11, 2009 10:15 AM Subject: [Proto-Scripty] Re: text from php flashes by!? Alex, It's just that wheb flaglast is true the code new Ajax.Updater( 'updateDiv', 'fv-c1-arrays4-mysql-minus-wm.php', { asynchronous:true, method:'post', parameters: params } ); works fine and updates the mysql database using the php file but the text message coming back from the php file into the updateDiv only stays on the screen for a split second unless I add the alert! Of course I do not want the alert but by chance I found that having the alert for some reason causes the message to stay on the screen ... Cheers Geoff On Jul 11, 9:57 am, "Alex McAuley" wrote: > Can you explain it a bit better as i cant understand what you are asking ! > > Alex > > - Original Message - > From: "geoffcox" > To: "Prototype & script.aculo.us" > > Sent: Saturday, July 11, 2009 9:53 AM > Subject: [Proto-Scripty] text from php flashes by!? > > > Hello, > > > Can anyone see why unless I have > > > alert("press OK"); or some other alert message, > > > when flaglast is true, the text coming from the php script only stays > > on the screen for a split second! > > > Thanks > > > Geoff > > > if (flag10 == true) { > > new Ajax.Updater( > > 'updateDiv', > > 'fv-c1-arrays4-mysql-minus-wm.php', > > { > > asynchronous:true, > > method:'post', > > parameters: params > > } > > ); > > resultsSaved = true; > > flag10 = false; > > > } else if (flaglast == true) { > > alert("press OK"); > > new Ajax.Updater( > > 'updateDiv', > > 'fv-c1-arrays4-mysql-minus-wm.php', > > { > > asynchronous:true, > > method:'post', > > parameters: params > > } > > ); > > resultsSaved = true; > > flaglast = false; > > } else { > > alert("oops"); > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: text from php flashes by!?
Alex, It's just that wheb flaglast is true the code new Ajax.Updater( 'updateDiv', 'fv-c1-arrays4-mysql-minus-wm.php', { asynchronous:true, method:'post', parameters: params } ); works fine and updates the mysql database using the php file but the text message coming back from the php file into the updateDiv only stays on the screen for a split second unless I add the alert! Of course I do not want the alert but by chance I found that having the alert for some reason causes the message to stay on the screen ... Cheers Geoff On Jul 11, 9:57 am, "Alex McAuley" wrote: > Can you explain it a bit better as i cant understand what you are asking ! > > Alex > > - Original Message - > From: "geoffcox" > To: "Prototype & script.aculo.us" > Sent: Saturday, July 11, 2009 9:53 AM > Subject: [Proto-Scripty] text from php flashes by!? > > > Hello, > > > Can anyone see why unless I have > > > alert("press OK"); or some other alert message, > > > when flaglast is true, the text coming from the php script only stays > > on the screen for a split second! > > > Thanks > > > Geoff > > > if (flag10 == true) { > > new Ajax.Updater( > > 'updateDiv', > > 'fv-c1-arrays4-mysql-minus-wm.php', > > { > > asynchronous:true, > > method:'post', > > parameters: params > > } > > ); > > resultsSaved = true; > > flag10 = false; > > > } else if (flaglast == true) { > > alert("press OK"); > > new Ajax.Updater( > > 'updateDiv', > > 'fv-c1-arrays4-mysql-minus-wm.php', > > { > > asynchronous:true, > > method:'post', > > parameters: params > > } > > ); > > resultsSaved = true; > > flaglast = false; > > } else { > > alert("oops"); > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: text from php flashes by!?
Can you explain it a bit better as i cant understand what you are asking ! Alex - Original Message - From: "geoffcox" To: "Prototype & script.aculo.us" Sent: Saturday, July 11, 2009 9:53 AM Subject: [Proto-Scripty] text from php flashes by!? > > Hello, > > Can anyone see why unless I have > > alert("press OK"); or some other alert message, > > when flaglast is true, the text coming from the php script only stays > on the screen for a split second! > > Thanks > > Geoff > > if (flag10 == true) { >new Ajax.Updater( >'updateDiv', >'fv-c1-arrays4-mysql-minus-wm.php', >{ >asynchronous:true, >method:'post', >parameters: params >} >); > resultsSaved = true; > flag10 = false; > > } else if (flaglast == true) { > alert("press OK"); >new Ajax.Updater( >'updateDiv', >'fv-c1-arrays4-mysql-minus-wm.php', >{ >asynchronous:true, >method:'post', >parameters: params >} >); > resultsSaved = true; > flaglast = false; > } else { > alert("oops"); > } > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---