From david at dorward.me.uk Tue Apr 1 02:05:49 2008 From: david at dorward.me.uk (David Dorward) Date: Tue, 1 Apr 2008 08:05:49 +0100 Subject: [Javascript] Grab close window call In-Reply-To: References: Message-ID: On 31 Mar 2008, at 23:26, Alan Easton wrote: > > I have a pop up window on my site, that launches a chat window. > Now, I would like to set a flag in my database, when someone ends > the chat. Easy done, if someone clicks the "End Session" link in > the window, but what if someone simply closes the window by the > normal means of clicking "close" icon in the top right of the window. What if their browser crashes? Or their network connection goes down? Set the flag if you can't communicate with the browser for $some_time_period. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From alaneaston666 at hotmail.com Tue Apr 1 06:30:57 2008 From: alaneaston666 at hotmail.com (Alan Easton) Date: Tue, 1 Apr 2008 12:30:57 +0100 Subject: [Javascript] Grab close window call In-Reply-To: <2008331204523.239359@DAVIDS> References: <2008331204523.239359@DAVIDS> Message-ID: Hello, Thanks for the advice so far. What I have done is this. I have a page, that launches a pop window. Now, on the pop up window, I have this code in the ---------------------------- ---------------------------- But I need to change the "return" statement to grab if they click "OK" or Cancel", as if they click "OK", I want to grab this and fire of an ajax call, and same goes for if the click "Cancel" I need to fire off an ajax call if they do that as well. How can I alter that "return" statement to cope with these 2. Any ideas would be great. Thanks, Alan...> From: davidh126 at writeme.com> To: javascript at lists.evolt.org> Date: Mon, 31 Mar 2008 20:45:23 -0700> Subject: Re: [Javascript] Grab close window call> > On Mon, 31 Mar 2008 23:26:10 +0100, Alan Easton wrote:> > Hi All,> >> > I have a problem, which I am not sure is solvable.> >> > I have a pop up window on my site, that launches a chat window. Now, I would like to> > set a flag in my database, when someone ends the chat. Easy done, if someone clicks the> > "End Session" link in the window, but what if someone simply closes the window by the> > normal means of clicking "close" icon in the top right of the window.> >> > Ideally, I would like to grab that call, and set an Ajax call to update my database.> >> > Is this possible?> >> > I believe the "window.onunload" event is the one you are looking for.> > Cordially,> David> --> > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Welcome to the next generation of Windows Live http://www.windowslive.co.uk/get-live -------------- next part -------------- An HTML attachment was scrubbed... URL: From Mark.Rees at astrazeneca.com Tue Apr 1 07:11:15 2008 From: Mark.Rees at astrazeneca.com (Rees, Mark) Date: Tue, 1 Apr 2008 13:11:15 +0100 Subject: [Javascript] Grab close window call In-Reply-To: Message-ID: Hello, Thanks for the advice so far. What I have done is this. I have a page, that launches a pop window. Now, on the pop up window, I have this code in the ---------------------------- ---------------------------- But I need to change the "return" statement to grab if they click "OK" or Cancel", as if they click "OK", I want to grab this and fire of an ajax call, and same goes for if the click "Cancel" I need to fire off an ajax call if they do that as well. How can I alter that "return" statement to cope with these 2. Any ideas would be great. Thanks, Alan... Use "confirm", like this if(confirm('do you want to close this page')){ //do this }else{ //do that } -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Tue Apr 1 07:58:52 2008 From: tedd at sperling.com (tedd) Date: Tue, 1 Apr 2008 08:58:52 -0400 Subject: [Javascript] Grab close window call In-Reply-To: References: <2008331204523.239359@DAVIDS> Message-ID: At 12:30 PM +0100 4/1/08, Alan Easton wrote: > >Any ideas would be great. My advice: 1. Don't annoy the user with "Do you want to close this?" -- s/he already made their choice. 2. Do "End of Session" via the "End of Session" link and window.onbeforeunload. 3. Do a periodic time check in your dB for unclosed sessions and set them accordingly. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From alaneaston666 at hotmail.com Tue Apr 1 08:06:35 2008 From: alaneaston666 at hotmail.com (Alan Easton) Date: Tue, 1 Apr 2008 14:06:35 +0100 Subject: [Javascript] Grab close window call In-Reply-To: References: <2008331204523.239359@DAVIDS> Message-ID: Thanks Tedd, So what you are saying is get rid of the check, and just do a ajax call straigha way, so something like: ------------------------- ------------------------- Is that what you reckon? Alan... > Date: Tue, 1 Apr 2008 08:58:52 -0400> To: javascript at lists.evolt.org> From: tedd at sperling.com> Subject: Re: [Javascript] Grab close window call> > At 12:30 PM +0100 4/1/08, Alan Easton wrote:> >> >Any ideas would be great.> > > My advice:> > 1. Don't annoy the user with "Do you want to close this?" -- s/he > already made their choice.> 2. Do "End of Session" via the "End of Session" link and window.onbeforeunload.> 3. Do a periodic time check in your dB for unclosed sessions and set > them accordingly.> > Cheers,> > tedd> -- > -------> http://sperling.com http://ancientstones.com http://earthstones.com> _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ The next generation of Windows Live is here http://www.windowslive.co.uk/get-live -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Tue Apr 1 09:05:27 2008 From: tedd at sperling.com (tedd) Date: Tue, 1 Apr 2008 10:05:27 -0400 Subject: [Javascript] Grab close window call In-Reply-To: References: <2008331204523.239359@DAVIDS> Message-ID: At 2:06 PM +0100 4/1/08, Alan Easton wrote: >Thanks Tedd, > >So what you are saying is get rid of the check, and just do a ajax >call straigha way, so something like: It doesn't have to be ajax -- it just has to record in your dB that the user closed the window. How you do that is of no concern to the user, is it? My point was simply to leave the user alone with what they want and expect to do. My Safari browser occasionally, for no apparent reason, reports back to me "Do you really want to quit" and I always think "Yes, dummy -- that's why I selected quit!" I never want any of my work to be thought of as "dumb". Respect the user's actions with small stuff and confirm with important stuff. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From alaneaston666 at hotmail.com Tue Apr 1 09:09:59 2008 From: alaneaston666 at hotmail.com (Alan Easton) Date: Tue, 1 Apr 2008 15:09:59 +0100 Subject: [Javascript] Grab close window call In-Reply-To: References: <2008331204523.239359@DAVIDS> Message-ID: Hi tedd, Yes, you are right. I just wanted to record the action of closing the window, which this does. And it is of no concern to the user how I record it in the DB, but I will make an ajax call at that point. Thanks for your help, Alan... > Date: Tue, 1 Apr 2008 10:05:27 -0400> To: javascript at lists.evolt.org> From: tedd at sperling.com> Subject: Re: [Javascript] Grab close window call> > At 2:06 PM +0100 4/1/08, Alan Easton wrote:> >Thanks Tedd,> >> >So what you are saying is get rid of the check, and just do a ajax > >call straigha way, so something like:> > It doesn't have to be ajax -- it just has to record in your dB that > the user closed the window. How you do that is of no concern to the > user, is it?> > My point was simply to leave the user alone with what they want and > expect to do.> > My Safari browser occasionally, for no apparent reason, reports back > to me "Do you really want to quit" and I always think "Yes, dummy -- > that's why I selected quit!"> > I never want any of my work to be thought of as "dumb". Respect the > user's actions with small stuff and confirm with important stuff.> > Cheers,> > tedd> -- > -------> http://sperling.com http://ancientstones.com http://earthstones.com> _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ The next generation of Windows Live is here http://www.windowslive.co.uk/get-live -------------- next part -------------- An HTML attachment was scrubbed... URL: From hassan at webtuitive.com Tue Apr 1 09:21:31 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Tue, 01 Apr 2008 07:21:31 -0700 Subject: [Javascript] Grab close window call In-Reply-To: References: <2008331204523.239359@DAVIDS> Message-ID: <47F244EB.5000508@webtuitive.com> Alan Easton wrote: > And it is of no concern to the user how I record it in the DB, but I > will make an ajax call at that point. though -- belt and suspenders -- you probably want to also do the previously recommended: 3. Do a periodic time check in your dB for unclosed sessions and set them accordingly. :: as you can't be sure that the user's browser supports "unload" or "beforeunload" -- Safari (current version) doesn't seem to... FWIW, -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From alaneaston666 at hotmail.com Tue Apr 1 09:56:03 2008 From: alaneaston666 at hotmail.com (Alan Easton) Date: Tue, 1 Apr 2008 15:56:03 +0100 Subject: [Javascript] Grab close window call In-Reply-To: <47F244EB.5000508@webtuitive.com> References: <2008331204523.239359@DAVIDS> <47F244EB.5000508@webtuitive.com> Message-ID: Thanks Hassan and Tedd, You are both right. I am going to run a script on the half hour, to check for expired sessions, and then force the flag to be set how I want, as like you say, some browsers do not support certain JS calls. Thanks again, Alan...> Date: Tue, 1 Apr 2008 07:21:31 -0700> From: hassan at webtuitive.com> To: javascript at lists.evolt.org> Subject: Re: [Javascript] Grab close window call> > Alan Easton wrote:> > > And it is of no concern to the user how I record it in the DB, but I > > will make an ajax call at that point.> > though -- belt and suspenders -- you probably want to also do the> previously recommended:> > 3. Do a periodic time check in your dB for unclosed sessions and set> them accordingly.> > :: as you can't be sure that the user's browser supports "unload" or> "beforeunload" -- Safari (current version) doesn't seem to...> > FWIW,> -- > Hassan Schroeder ----------------------------- hassan at webtuitive.com> Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com> > dream. code.> _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Amazing prizes every hour with Live Search Big Snap http://www.bigsnapsearch.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From riegel at clearimageonline.com Tue Apr 1 19:50:38 2008 From: riegel at clearimageonline.com (Terry Riegel) Date: Tue, 1 Apr 2008 20:50:38 -0400 Subject: [Javascript] Grab close window call In-Reply-To: References: <2008331204523.239359@DAVIDS> Message-ID: <98431F2F-22CE-4097-9B2B-5867679354B8@clearimageonline.com> > My Safari browser occasionally, for no apparent reason, reports back > to me "Do you really want to quit" and I always think "Yes, dummy -- > that's why I selected quit!" Safari does that when the user has multiple window or tabs that will be closed as a result of the exit. I know this because it wasn't always this way and I have inadvertently lost several things in the past when quoting the wrong program. From tedd at sperling.com Wed Apr 2 08:31:30 2008 From: tedd at sperling.com (tedd) Date: Wed, 2 Apr 2008 09:31:30 -0400 Subject: [Javascript] Grab close window call In-Reply-To: <98431F2F-22CE-4097-9B2B-5867679354B8@clearimageonline.com> References: <2008331204523.239359@DAVIDS> <98431F2F-22CE-4097-9B2B-5867679354B8@clearimageonline.com> Message-ID: At 8:50 PM -0400 4/1/08, Terry Riegel wrote: > > My Safari browser occasionally, for no apparent reason, reports back >> to me "Do you really want to quit" and I always think "Yes, dummy -- >> that's why I selected quit!" > >Safari does that when the user has multiple window or tabs that will >be closed as a result of the exit. I know this because it wasn't >always this way and I have inadvertently lost several things in the >past when quoting the wrong program. Ahhh, so that's the reason why it does it occasionally. That makes sense, but it would be better as an option to set in preferences than make it mandatory. The older Safaris didn't do that. Thanks for explaining that for me. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From nick at nickfitz.co.uk Wed Apr 2 09:41:02 2008 From: nick at nickfitz.co.uk (Nick Fitzsimons) Date: Wed, 2 Apr 2008 15:41:02 +0100 (BST) Subject: [Javascript] Grab close window call In-Reply-To: References: <2008331204523.239359@DAVIDS> <98431F2F-22CE-4097-9B2B-5867679354B8@clearimageonline.com> Message-ID: <10215.193.195.164.58.1207147262.squirrel@www.easilymail.co.uk> On Wed, April 2, 2008 2:31 pm, tedd wrote: > > Ahhh, so that's the reason why it does it occasionally. That makes > sense, but it would be better as an option to set in preferences than > make it mandatory. The older Safaris didn't do that. > Preferences > Tabs > Confirm when closing multiple pages HTH, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ From evolt at dragonzreef.com Fri Apr 4 12:18:52 2008 From: evolt at dragonzreef.com (Andy Harrison) Date: Fri, 4 Apr 2008 13:18:52 -0400 Subject: [Javascript] "unterminated string literal" error Message-ID: <2a0f7be00804041018x49321010wdaed1c381ec1a221@mail.gmail.com> As an experiment, I'm trying to open a new window using a data URL. In one scenario I get an error and I don't understand why. This works fine: window.open('data:text/html,%3Chtml%3E%0D%0A'+ '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ '%3C%2Fhtml%3E'); But if I put it in a string (e.g., the href attribute of a hyperlink, preceded by "javascript:"), I get an "unterminated string literal" error: eval("window.open('data:text/html,%3Chtml%3E%0D%0A'+ '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ '%3C%2Fhtml%3E');"); I know it has something to do with %0D%0A (carriage-return, line-feed), because both work fine if I remove them--but then the new lines don't show up in the source code of the new window. Not important, I know, but I'm curious. Any ideas why this is happening? Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From evolt at dragonzreef.com Fri Apr 4 12:18:52 2008 From: evolt at dragonzreef.com (Andy Harrison) Date: Fri, 4 Apr 2008 13:18:52 -0400 Subject: [Javascript] "unterminated string literal" error Message-ID: <2a0f7be00804041018x49321010wdaed1c381ec1a221@mail.gmail.com> As an experiment, I'm trying to open a new window using a data URL. In one scenario I get an error and I don't understand why. This works fine: window.open('data:text/html,%3Chtml%3E%0D%0A'+ '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ '%3C%2Fhtml%3E'); But if I put it in a string (e.g., the href attribute of a hyperlink, preceded by "javascript:"), I get an "unterminated string literal" error: eval("window.open('data:text/html,%3Chtml%3E%0D%0A'+ '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ '%3C%2Fhtml%3E');"); I know it has something to do with %0D%0A (carriage-return, line-feed), because both work fine if I remove them--but then the new lines don't show up in the source code of the new window. Not important, I know, but I'm curious. Any ideas why this is happening? Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From dnunes at gmail.com Fri Apr 4 12:31:10 2008 From: dnunes at gmail.com (diego nunes) Date: Fri, 4 Apr 2008 14:31:10 -0300 Subject: [Javascript] "unterminated string literal" error In-Reply-To: <2a0f7be00804041018x49321010wdaed1c381ec1a221@mail.gmail.com> References: <2a0f7be00804041018x49321010wdaed1c381ec1a221@mail.gmail.com> Message-ID: <14f57d420804041031i180726b0w3ae939f4d052f478@mail.gmail.com> On 4/4/08, Andy Harrison wrote: > I know it has something to do with %0D%0A (carriage-return, line-feed), > because both work fine if I remove them--but then the new lines don't show > up in the source code of the new window. Not important, I know, but I'm > curious. Any ideas why this is happening? Well, Javascript is evaluating your code, and it end up looking like... var unterminatedError='http://mimi.com/blabla kmkdfm'; No ideas on how to make it work keeping the current functionality, though. -- diego nunes dnunes.com From peter at brunone.com Fri Apr 4 12:30:45 2008 From: peter at brunone.com (Peter Brunone) Date: Fri, 4 Apr 2008 10:30:45 -0700 Subject: [Javascript] "unterminated string literal" error Message-ID: <2ec43ce548414db09aeb1c234130a242@maila15.webcontrolcenter.com> Is this some proof-of-concept tour of what Javascript can do with hex encoding? I don't think you can continue a string on the next line. You've closed the string and added the concatenation operator in the first example, but in the second, you've left the greater string wide open. Cheers, Peter ---------------------------------------- From: "Andy Harrison" As an experiment, I'm trying to open a new window using a data URL. In one scenario I get an error and I don't understand why. This works fine: window.open('data:text/html,%3Chtml%3E%0D%0A'+ '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ '%3C%2Fhtml%3E'); But if I put it in a string (e.g., the href attribute of a hyperlink, preceded by "javascript:"), I get an "unterminated string literal" error: eval("window.open('data:text/html,%3Chtml%3E%0D%0A'+ '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ '%3C%2Fhtml%3E');"); I know it has something to do with %0D%0A (carriage-return, line-feed), because both work fine if I remove them--but then the new lines don't show up in the source code of the new window. Not important, I know, but I'm curious. Any ideas why this is happening? Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From evolt at dragonzreef.com Fri Apr 4 12:53:39 2008 From: evolt at dragonzreef.com (Andy Harrison) Date: Fri, 4 Apr 2008 13:53:39 -0400 Subject: [Javascript] "unterminated string literal" error In-Reply-To: <2ec43ce548414db09aeb1c234130a242@maila15.webcontrolcenter.com> References: <2ec43ce548414db09aeb1c234130a242@maila15.webcontrolcenter.com> Message-ID: <2a0f7be00804041053l53c12966x7f77c8dbc483f385@mail.gmail.com> Thanks Peter -- I can't believe I totally missed that. Both examples work now. It still doesn't work if I put it directly in a hyperlink though (unless I remove the new lines): test BTW, I'm just experimenting - I just discovered data URLs and am seeing what kinds of things I can do with them. Andy On Fri, Apr 4, 2008 at 1:30 PM, Peter Brunone wrote: > Is this some proof-of-concept tour of what Javascript can do with hex > encoding? > > I don't think you can continue a string on the next line. You've closed > the string and added the concatenation operator in the first example, but in > the second, you've left the greater string wide open. > > Cheers, > > Peter > > ------------------------------ > *From*: "Andy Harrison" > > As an experiment, I'm trying to open a new window using a data URL. In > one scenario I get an error and I don't understand why. > > This works fine: > > window.open('data:text/html,%3Chtml%3E%0D%0A'+ > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > '%3C%2Fhtml%3E'); > > > But if I put it in a string (e.g., the href attribute of a hyperlink, > preceded by "javascript:"), I get an "unterminated string literal" error: > > eval("window.open('data:text/html,%3Chtml%3E%0D%0A'+ > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > '%3C%2Fhtml%3E');"); > > I know it has something to do with %0D%0A (carriage-return, line-feed), > because both work fine if I remove them--but then the new lines don't show > up in the source code of the new window. Not important, I know, but I'm > curious. Any ideas why this is happening? > > Andy > > > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript > -------------- next part -------------- An HTML attachment was scrubbed... URL: From evolt at dragonzreef.com Fri Apr 4 13:00:10 2008 From: evolt at dragonzreef.com (Andy Harrison) Date: Fri, 4 Apr 2008 14:00:10 -0400 Subject: [Javascript] "unterminated string literal" error In-Reply-To: <2a0f7be00804041053l53c12966x7f77c8dbc483f385@mail.gmail.com> References: <2ec43ce548414db09aeb1c234130a242@maila15.webcontrolcenter.com> <2a0f7be00804041053l53c12966x7f77c8dbc483f385@mail.gmail.com> Message-ID: <2a0f7be00804041100p1567fbc0x62d22f2fcc066aa0@mail.gmail.com> Just figured it out - in the hyperlink I have to replace "%0D%0A" with "\r\n". I guess the string is unescaped before the javascript sees it. On Fri, Apr 4, 2008 at 1:53 PM, Andy Harrison wrote: > Thanks Peter -- I can't believe I totally missed that. Both examples work > now. It still doesn't work if I put it directly in a hyperlink though > (unless I remove the new lines): > > href="javascript:window.open('data:text/html,%3Chtml%3E%0D%0A%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E');">test > BTW, I'm just experimenting - I just discovered data URLs and am seeing > what kinds of things I can do with them. > > Andy > > On Fri, Apr 4, 2008 at 1:30 PM, Peter Brunone wrote: > > > Is this some proof-of-concept tour of what Javascript can do with hex > > encoding? > > > > I don't think you can continue a string on the next line. You've closed > > the string and added the concatenation operator in the first example, but in > > the second, you've left the greater string wide open. > > > > Cheers, > > > > Peter > > > > ------------------------------ > > *From*: "Andy Harrison" > > > > As an experiment, I'm trying to open a new window using a data URL. In > > one scenario I get an error and I don't understand why. > > > > This works fine: > > > > window.open('data:text/html,%3Chtml%3E%0D%0A'+ > > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > > '%3C%2Fhtml%3E'); > > > > > > But if I put it in a string (e.g., the href attribute of a hyperlink, > > preceded by "javascript:"), I get an "unterminated string literal" error: > > > > eval("window.open('data:text/html,%3Chtml%3E%0D%0A'+ > > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > > '%3C%2Fhtml%3E');"); > > > > I know it has something to do with %0D%0A (carriage-return, line-feed), > > because both work fine if I remove them--but then the new lines don't show > > up in the source code of the new window. Not important, I know, but I'm > > curious. Any ideas why this is happening? > > > > Andy > > > > > > _______________________________________________ > > Javascript mailing list > > Javascript at lists.evolt.org > > http://lists.evolt.org/mailman/listinfo/javascript > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From evolt at dragonzreef.com Fri Apr 4 13:00:10 2008 From: evolt at dragonzreef.com (Andy Harrison) Date: Fri, 4 Apr 2008 14:00:10 -0400 Subject: [Javascript] "unterminated string literal" error In-Reply-To: <2a0f7be00804041053l53c12966x7f77c8dbc483f385@mail.gmail.com> References: <2ec43ce548414db09aeb1c234130a242@maila15.webcontrolcenter.com> <2a0f7be00804041053l53c12966x7f77c8dbc483f385@mail.gmail.com> Message-ID: <2a0f7be00804041100p1567fbc0x62d22f2fcc066aa0@mail.gmail.com> Just figured it out - in the hyperlink I have to replace "%0D%0A" with "\r\n". I guess the string is unescaped before the javascript sees it. On Fri, Apr 4, 2008 at 1:53 PM, Andy Harrison wrote: > Thanks Peter -- I can't believe I totally missed that. Both examples work > now. It still doesn't work if I put it directly in a hyperlink though > (unless I remove the new lines): > > href="javascript:window.open('data:text/html,%3Chtml%3E%0D%0A%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E');">test > BTW, I'm just experimenting - I just discovered data URLs and am seeing > what kinds of things I can do with them. > > Andy > > On Fri, Apr 4, 2008 at 1:30 PM, Peter Brunone wrote: > > > Is this some proof-of-concept tour of what Javascript can do with hex > > encoding? > > > > I don't think you can continue a string on the next line. You've closed > > the string and added the concatenation operator in the first example, but in > > the second, you've left the greater string wide open. > > > > Cheers, > > > > Peter > > > > ------------------------------ > > *From*: "Andy Harrison" > > > > As an experiment, I'm trying to open a new window using a data URL. In > > one scenario I get an error and I don't understand why. > > > > This works fine: > > > > window.open('data:text/html,%3Chtml%3E%0D%0A'+ > > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > > '%3C%2Fhtml%3E'); > > > > > > But if I put it in a string (e.g., the href attribute of a hyperlink, > > preceded by "javascript:"), I get an "unterminated string literal" error: > > > > eval("window.open('data:text/html,%3Chtml%3E%0D%0A'+ > > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > > '%3C%2Fhtml%3E');"); > > > > I know it has something to do with %0D%0A (carriage-return, line-feed), > > because both work fine if I remove them--but then the new lines don't show > > up in the source code of the new window. Not important, I know, but I'm > > curious. Any ideas why this is happening? > > > > Andy > > > > > > _______________________________________________ > > Javascript mailing list > > Javascript at lists.evolt.org > > http://lists.evolt.org/mailman/listinfo/javascript > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From evolt at dragonzreef.com Fri Apr 4 13:00:10 2008 From: evolt at dragonzreef.com (Andy Harrison) Date: Fri, 4 Apr 2008 14:00:10 -0400 Subject: [Javascript] "unterminated string literal" error In-Reply-To: <2a0f7be00804041053l53c12966x7f77c8dbc483f385@mail.gmail.com> References: <2ec43ce548414db09aeb1c234130a242@maila15.webcontrolcenter.com> <2a0f7be00804041053l53c12966x7f77c8dbc483f385@mail.gmail.com> Message-ID: <2a0f7be00804041100p1567fbc0x62d22f2fcc066aa0@mail.gmail.com> Just figured it out - in the hyperlink I have to replace "%0D%0A" with "\r\n". I guess the string is unescaped before the javascript sees it. On Fri, Apr 4, 2008 at 1:53 PM, Andy Harrison wrote: > Thanks Peter -- I can't believe I totally missed that. Both examples work > now. It still doesn't work if I put it directly in a hyperlink though > (unless I remove the new lines): > > href="javascript:window.open('data:text/html,%3Chtml%3E%0D%0A%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E');">test > BTW, I'm just experimenting - I just discovered data URLs and am seeing > what kinds of things I can do with them. > > Andy > > On Fri, Apr 4, 2008 at 1:30 PM, Peter Brunone wrote: > > > Is this some proof-of-concept tour of what Javascript can do with hex > > encoding? > > > > I don't think you can continue a string on the next line. You've closed > > the string and added the concatenation operator in the first example, but in > > the second, you've left the greater string wide open. > > > > Cheers, > > > > Peter > > > > ------------------------------ > > *From*: "Andy Harrison" > > > > As an experiment, I'm trying to open a new window using a data URL. In > > one scenario I get an error and I don't understand why. > > > > This works fine: > > > > window.open('data:text/html,%3Chtml%3E%0D%0A'+ > > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > > '%3C%2Fhtml%3E'); > > > > > > But if I put it in a string (e.g., the href attribute of a hyperlink, > > preceded by "javascript:"), I get an "unterminated string literal" error: > > > > eval("window.open('data:text/html,%3Chtml%3E%0D%0A'+ > > '%3Chead%3E%3Ctitle%3Etest%3C%2Ftitle%3E%3C%2Fhead%3E%0D%0A'+ > > '%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%0D%0A'+ > > '%3C%2Fhtml%3E');"); > > > > I know it has something to do with %0D%0A (carriage-return, line-feed), > > because both work fine if I remove them--but then the new lines don't show > > up in the source code of the new window. Not important, I know, but I'm > > curious. Any ideas why this is happening? > > > > Andy > > > > > > _______________________________________________ > > Javascript mailing list > > Javascript at lists.evolt.org > > http://lists.evolt.org/mailman/listinfo/javascript > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Fri Apr 11 15:56:38 2008 From: tedd at sperling.com (tedd) Date: Fri, 11 Apr 2008 16:56:38 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) Message-ID: Hi gang: I wrote the following application and it works fine on most browsers except for IE's. http://webbytedd.com/quarters It seems that IE js doesn't understand the following statement: document.getElementById(id).checked = true; Granted all that line does is to set a checkbox variable (id) to 'on'. Surely, some $M code can do that, right? After reading a bunch, it seems that M$ has a better way to do things (big surprise there, huh?) and thus does not use the document.getElementById(id) thing that everyone else in the world uses. Instead, they use something "better" and it's not documented well, as is typical. Unfortunately, I have not been able to find a work-a-round. So, what I need is: if (document.getElementById) { document.getElementById(id).checked = true; } else { <<<<< inset solution here. >>>>>> } All the code has to do is to set a simple checkbox to 'on' in IE. Anyone have any ideas? Cheers, tedd PS: I've posted this question on the php list as well. PSS: You have to wonder how much more technically advanced we would be if we weren't always held back by the "what's in it for me" shortsightedness of M$. -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From peter at brunone.com Fri Apr 11 16:24:28 2008 From: peter at brunone.com (Peter Brunone) Date: Fri, 11 Apr 2008 14:24:28 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) Message-ID: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> Hi Tedd, Are you sure you're not mistaken? I have never heard that IE wouldn't respect document.getElementById, and in fact when I tried just now to check a checkbox via Javascript, it worked for me. My code looked exactly like this: document.getElementById("ShouldDisplayAttachments").checked=true; And please... I'm no Microsoft flunkie, but acting like they're singlehandedly holding back the web? That's just a teeny bit silly. Cheers, Peter ---------------------------------------- From: tedd tedd at sperling.com Hi gang: I wrote the following application and it works fine on most browsers except for IE's. http://webbytedd.com/quarters It seems that IE js doesn't understand the following statement: document.getElementById(id).checked = true; Granted all that line does is to set a checkbox variable (id) to 'on'. Surely, some $M code can do that, right? After reading a bunch, it seems that M$ has a better way to do things (big surprise there, huh?) and thus does not use the document.getElementById(id) thing that everyone else in the world uses. Instead, they use something "better" and it's not documented well, as is typical. Unfortunately, I have not been able to find a work-a-round. So, what I need is: if (document.getElementById) { document.getElementById(id).checked = true; } else { <<<<< inset solution here. >>>>>> } All the code has to do is to set a simple checkbox to 'on' in IE. Anyone have any ideas? Cheers, tedd PS: I've posted this question on the php list as well. PSS: You have to wonder how much more technically advanced we would be if we weren't always held back by the "what's in it for me" shortsightedness of M$. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdougherty at pbp.com Fri Apr 11 16:48:14 2008 From: mdougherty at pbp.com (Mike Dougherty) Date: Fri, 11 Apr 2008 16:48:14 -0500 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> Message-ID: <59bedf280804111448p2d52de63yf929ebb69b3f9e46@mail.gmail.com> On Fri, Apr 11, 2008 at 4:24 PM, Peter Brunone wrote: > And please... I'm no Microsoft flunkie, but acting like they're > singlehandedly holding back the web? That's just a teeny bit silly. Of course it wasn't singlehandedly. They've convinced a lot of people that since they already have such a large market share that they ARE the standards body. The are also a lot of IE-proprietary code examples on the web that novice developers encounter while looking for how to write solutions. That these examples are 5+ years out of date is not obvious to those who don't know differently. I may be more bitter than usual since I spent 3 hours today sleuthing an IE CSS problem (which I won't discuss on a javascript list) From dnunes at gmail.com Fri Apr 11 17:12:26 2008 From: dnunes at gmail.com (diego nunes) Date: Fri, 11 Apr 2008 19:12:26 -0300 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: Message-ID: <14f57d420804111512m14bf8a6fwa68233961387f05b@mail.gmail.com> On 4/11/08, tedd wrote: > All the code has to do is to set a simple checkbox to 'on' in IE. "elementReference.checked='checked';" should work (XHTML compatible as well), but simply using "true" should do the job as well. I use a code almost exactly like this and work flawless in all browsers that does suport CSS and DOM. Did you tried to check if the element reference is correct? You may be using it too early and the browser didn't rendered it yet or something. -- diego nunes dnunes.com From schneegans at internetique.com Fri Apr 11 16:44:28 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Fri, 11 Apr 2008 17:44:28 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> Message-ID: <47FFDBBC.5040505@internetique.com> >>Are you sure you're not mistaken? I have never heard that IE wouldn't respect document.getElementById LOL, not only IE supports getElementById, but it invented it! It then became a standard, and all others are following it. Tedd, your sarcastic remarks should taste bitter in your mouth ;-) The only reason I see this could not work would be: 1. there is no element Id 2. there is more than one, in this case nobody knows what can happen. 3. the element Id is not a checkbox or a radio button. -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon at internetique.com) Thanks. From davidh126 at writeme.com Fri Apr 11 17:48:19 2008 From: davidh126 at writeme.com (David Hucklesby) Date: Fri, 11 Apr 2008 15:48:19 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: Message-ID: <2008411154819.291885@DAVIDS> On Fri, 11 Apr 2008 16:56:38 -0400, tedd wrote: > Hi gang: > > I wrote the following application and it works fine on most browsers except for IE's. > > http://webbytedd.com/quarters > > It seems that IE js doesn't understand the following statement: > > document.getElementById(id).checked = true; > [...] > > All the code has to do is to set a simple checkbox to 'on' in IE. > Hi Tedd, This seems to work cross-browser this end (Win xp pro; IE7 and "standalone" IE 5.5 and 6, as well as other browsers: document.getElementById(id).setAttribute('checked', true); Cordially, David -- From hassan at webtuitive.com Fri Apr 11 18:28:14 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Fri, 11 Apr 2008 16:28:14 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <47FFDBBC.5040505@internetique.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> Message-ID: <47FFF40E.5050608@webtuitive.com> Claude Schneegans wrote: > LOL, not only IE supports getElementById, but it invented it! Citation? -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From peter at brunone.com Fri Apr 11 18:40:40 2008 From: peter at brunone.com (Peter Brunone) Date: Fri, 11 Apr 2008 16:40:40 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) Message-ID: I don't know if they invented it, but they were among the first -- if not THE first -- to implement it. I remember coding for Netscape in my early days, and then realizing that IE4 had introduced this brand-new way of referring to everything by ID; boy was I annoyed. How times change... Peter ---------------------------------------- From: Hassan Schroeder hassan at webtuitive.com Claude Schneegans wrote: > LOL, not only IE supports getElementById, but it invented it! Citation? -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nick at customdesigns.ca Fri Apr 11 18:43:21 2008 From: nick at customdesigns.ca (Nick Wiltshire) Date: Fri, 11 Apr 2008 17:43:21 -0600 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: Message-ID: <200804111743.21532.nick@customdesigns.ca> Kind of like that pesky Ajax thing :) On April 11, 2008 05:40:40 pm Peter Brunone wrote: > I don't know if they invented it, but they were among the first -- if not > THE first -- to implement it. I remember coding for Netscape in my early > days, and then realizing that IE4 had introduced this brand-new way of > referring to everything by ID; boy was I annoyed. > > How times change... > > Peter > > ---------------------------------------- > > From: Hassan Schroeder hassan at webtuitive.com > > Claude Schneegans wrote: > > LOL, not only IE supports getElementById, but it invented it! > > Citation? From schneegans at internetique.com Fri Apr 11 21:35:47 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Fri, 11 Apr 2008 22:35:47 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <47FFF40E.5050608@webtuitive.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <47FFF40E.5050608@webtuitive.com> Message-ID: <48002003.4090001@internetique.com> >>Citation? Why cite others? I have my own experience. Started with Netscape 1.0, Javascript didn't even exist. From tedd at sperling.com Sat Apr 12 08:25:48 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Apr 2008 09:25:48 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> Message-ID: At 2:24 PM -0700 4/11/08, Peter Brunone wrote: > And please... I'm no Microsoft flunkie, but acting like they're >singlehandedly holding back the web? That's just a teeny bit silly. Not silly at all. You said "singlehandedly" -- that reminds me of when Bill Gates was subpoenaed to appear in front of Congress defending M$ (re monopoly and predator pricing issues) and said that M$ was only one of several OS developers. The Congressman asked the audience to hold up their hand if they used Windows and the entire audience did. The Congressman replied "Looks like a monopoly to me." (or words to that affect). I don't want to start a flame war -- but -- M$ has held back technology for decades by selling a second-rate product and passing it off as "state of the art". They've been playing "catch-up" with Apple for their entire existence -- and I don't want to argue the point, because I lived it. I saw this first hand. And what about the net? Did they not use predator pricing to put Netscape out of the lead (if not out of business) and replaced it with their version of what a browser (i.e., IE) should be? What a joke that was -- and still is I might add. Just look at the time that css developers waste trying to get versions of IE to comply -- that's not a minor issue. I could go on, but what's the point? We ALL have to live with the M$ mistake. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Sat Apr 12 08:56:36 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Apr 2008 09:56:36 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <47FFDBBC.5040505@internetique.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> Message-ID: At 5:44 PM -0400 4/11/08, Claude Schneegans wrote: >The only reason I see this could not work would be: >1. there is no element Id >2. there is more than one, in this case nobody knows what can happen. >3. the element Id is not a checkbox or a radio button. Claude: 1. The element ID does exist. 2. There is only one element by that name. 3. That element is a checkbox. So, there must be another reason. However, in IE the code generates an: Error: 'document.getElementById(...) is null or not an object. The offending code is this: function HideTimedLayer(id) { document.getElementById(id).style.display = "none"; var id2 = 'c' + id[2] + id[3]; document.getElementById(id2).checked = true; } I do have checkboxs with the id's of q11 and c11. In the above function, I simply want checkbox q11 to be not shown and checkbox c11 to be checked. But, in IE the code generates the above error and in everything else, it works. So, what do you see the problem to be? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From lester at denhaag.org Sat Apr 12 09:13:27 2008 From: lester at denhaag.org (J. Lester Novros II) Date: Sat, 12 Apr 2008 16:13:27 +0200 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> Message-ID: <4800C387.60302@denhaag.org> Dear Tedd, This may be too obvious but whenever I get confronted with such a quandary, the first thing I do is alert the offending element/variable in xPloder to see what /it/ thinks my code should do, i.e. function HideTimedLayer(id) { document.getElementById(id).style.display = "none"; var id2 = 'c' + id[2] + id[3]; alert(id2 + '\n' + document.getElementById(id2)); // document.getElementById(id2).checked = true; } m$' poor excuse for its equiv of the Fox's DOM Inspector might also be helpful: it allows you to see what xPloder's, admittedly dim, view of the DOM of your document is so you can check (the IDs of) your elements. Oh, and FWIW, I wholeheartedly agree with your assessment of m$ holding back tech developments. I, too, suffer daily. Just my 0.02 Eur. l8R lES -- "I think a lot more of Apple than I do of MSFT, but then I'd rather catch rabies than AIDS..." /. comment http://www.supermarionation.tv From hassan at webtuitive.com Sat Apr 12 09:22:37 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sat, 12 Apr 2008 07:22:37 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> Message-ID: <4800C5AD.5060204@webtuitive.com> tedd wrote: > The offending code is this: > var id2 = 'c' + id[2] + id[3]; ? I've never seen that shorthand before; do you have a reference to JS treating a String as a byte array? In any case, you can fix this with a more standard: var id2 = 'c' + id.charAt(1) + id.charAt(2); though I probably would use a single id.substring(1) :-) HTH, -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From paul at juniperwebcraft.com Sat Apr 12 09:36:42 2008 From: paul at juniperwebcraft.com (Paul Novitski) Date: Sat, 12 Apr 2008 07:36:42 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <27623046.1208008743472.JavaMail.root@m04> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <27623046.1208008743472.JavaMail.root@m04> Message-ID: <3290855623-1068788042@mail.columbiawireless.ca> At 4/12/2008 06:56 AM, tedd wrote: > Error: 'document.getElementById(...) is null or not an object. > >The offending code is this: > >function HideTimedLayer(id) > { > document.getElementById(id).style.display = "none"; > var id2 = 'c' + id[2] + id[3]; > document.getElementById(id2).checked = true; > } Tedd, your code above (...id[2] + id[3]...) indicates that the variable id is an ARRAY. getElementById() takes a STRING as its argument. Paul _______________________ [sent earlier but didn't appear on the list:] At 4/11/2008 01:56 PM, tedd wrote: >document.getElementById(id).checked = true; Yeah, checked isn't a native DOM element property. Use setAttribute. http://developer.mozilla.org/en/docs/DOM:element#Properties http://developer.mozilla.org/en/docs/DOM:element.setAttribute Tangentially, I've gotten into the habit of keeping statements 'atomic': if (!typeof(id) == 'string') { debugAlert('id is not a string'); return false; } var oObj = document.getElementById(id); if (!oObj) { debugAlert('Cannot find ' + id); return false; } Obj.setAttribute('checked', true); ... If one component of a compound statement throws an error it can be difficult to debug. Yes, it is more verbose, but a) computers these days are very fast and JavaScript execution speed is almost never an issue and b) if splitting the compound statement into separate atomic statements makes it easier to catch run-time and compile errors, it has time-saving value for you the programmer and useability value for the visitor who is less likely to have JavaScript halt or bomb out. Of course I keep to a middle ground; I'm not afraid to combine some functionality such as a function call and text concatenation in one statement as above. The example you provided is particularly vulnerable because the overall statement (element.property = value) fails if getElementById(id) returns a null object when id is not found or if the property does not exist, but with no indicator of which component failed. The opaqueness of the error is evident by your suspicion that getElementById() isn't supported by IE, whereas I think it was 'checked' that killed the beast. Regards, Paul From tedd at sperling.com Sat Apr 12 09:37:46 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Apr 2008 10:37:46 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <4800C5AD.5060204@webtuitive.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> Message-ID: At 7:22 AM -0700 4/12/08, Hassan Schroeder wrote: >tedd wrote: > >> The offending code is this: > >> var id2 = 'c' + id[2] + id[3]; > >? I've never seen that shorthand before; do you have a reference to >JS treating a String as a byte array? No, I don't have a reference -- it's just one of those old habits from previous languages. In this case, it worked for breaking a string into its characters. It may not work in all cases and was not the reason for failure with my current problem. Cheers, tedd. -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From hassan at webtuitive.com Sat Apr 12 09:49:28 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sat, 12 Apr 2008 07:49:28 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> Message-ID: <4800CBF8.6090104@webtuitive.com> tedd wrote: > It may not work in all cases and was not the reason for failure with my > current problem. Sure it is -- it *doesn't* work in IE. Period. A simple `alert(id[2])` would show you, in IE, "undefined". So the 'id2' you're passing to the next statement is invalid. That *is* the reason document.getElementById() fails. OTOH, the change I suggested *does* work in IE as well as FF/Safari. -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From hassan at webtuitive.com Sat Apr 12 09:58:24 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sat, 12 Apr 2008 07:58:24 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <3290855623-1068788042@mail.columbiawireless.ca> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <27623046.1208008743472.JavaMail.root@m04> <3290855623-1068788042@mail.columbiawireless.ca> Message-ID: <4800CE10.3020308@webtuitive.com> Paul Novitski wrote: > Yeah, checked isn't a native DOM element property. Use setAttribute. > http://developer.mozilla.org/en/docs/DOM:element#Properties > http://developer.mozilla.org/en/docs/DOM:element.setAttribute Has this changed with IE7? I ask because I went through no end of grief with either IE 5.x or IE 6 not properly handling setAttribute, and it seemed that (at the time) the prevailing consensus was that setting attributes directly e.g. `foo.checked = true` was more cross-browser reliable. But it was definitely several years ago... -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From david at dorward.me.uk Sat Apr 12 10:19:03 2008 From: david at dorward.me.uk (David Dorward) Date: Sat, 12 Apr 2008 16:19:03 +0100 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <3290855623-1068788042@mail.columbiawireless.ca> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <27623046.1208008743472.JavaMail.root@m04> <3290855623-1068788042@mail.columbiawireless.ca> Message-ID: On 12 Apr 2008, at 15:36, Paul Novitski wrote: > > Tedd, your code above (...id[2] + id[3]...) indicates that the > variable id is an ARRAY. getElementById() takes a STRING as its > argument. Strings can be treated as character arrays: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:String#Character_access However, this isn't a part of JavaScript supported by Internet Explorer (I think it is new in JS 1.5). > At 4/11/2008 01:56 PM, tedd wrote: >> document.getElementById(id).checked = true; > > > Yeah, checked isn't a native DOM element property. No, it is: http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#attribute-checked > Use setAttribute. Avoid setAttribute, it is broken in Internet Explorer (worse then IE8 Best Standards Mode): http://www.quirksmode.org/dom/w3c_core.html#t910 -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From java.script at cutterscrossing.com Sat Apr 12 07:05:24 2008 From: java.script at cutterscrossing.com (Cutter (JSRelated)) Date: Sat, 12 Apr 2008 07:05:24 -0500 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: Message-ID: <4800A584.80405@cutterscrossing.com> Heh heh! I remember coding for Mosaic in my early days....;) Steve "Cutter" Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _____________________________ http://blog.cutterscrossing.com Peter Brunone wrote: > I don't know if they invented it, but they were among the first -- if > not THE first -- to implement it. I remember coding for Netscape in my > early days, and then realizing that IE4 had introduced this brand-new > way of referring to everything by ID; boy was I annoyed. > > How times change... > > Peter From schneegans at internetique.com Sat Apr 12 10:25:40 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Sat, 12 Apr 2008 11:25:40 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <47FFF40E.5050608@webtuitive.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <47FFF40E.5050608@webtuitive.com> Message-ID: <4800D474.6000908@internetique.com> >>Citation? OK, according to: http://developer.mozilla.org/en/docs/Browser_Detection_and_Cross_Browser_Support "With the introduction of the W3C DOM, the standard method |document.getElementById| became available in Internet Explorer 5 and later in Netscape 6 (Gecko)." According to: http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-011100101 The getElementById function was introduced in DOM Level 1, proposed as a standard october 1st 1998. Among the editors are: Vidur Apparao, Netscape Scott Isaacs, Microsoft (until January 1998) Chris Wilson, Microsoft (after January 1998) According to: http://wiki.wsu.edu/ctowiki/Microsoft_Internet_Explorer "Internet Explorer 5 was released in March 1999" thus only five month after the DOM level 1 specifications. According to: http://www.w3schools.com/browsers/browsers_netscape.asp "Netscape 6 was released in November 2000." thus 25 months after DOM level 1 and 20 months after Explorer 5. So may be Microsoft didn't "invent the function", but obviously they were the first to implement it, and they were working on its implementation in Explorer 5 while they were participating in the discussions to elaborate the standard. Obviously, Netscape was not ready yet. By the way, I'm not a "MS-Fan-Boy", actually I was a Netscape fan,... until they released Netscape 6 which didn't support previous versions. A lot of trouble for us developers. For now I'm nobody's fan, I just keep patching code to support what the visitors use to browse my sites. -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon at internetique.com) Thanks. From schneegans at internetique.com Sat Apr 12 10:34:40 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Sat, 12 Apr 2008 11:34:40 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> Message-ID: <4800D690.2040804@internetique.com> >>In this case, it worked for breaking a string into its characters. But what's the big idea of breaking a string into its character in order to make a string with them? Especially if those characters are "1" and "1" If id[2] and id[3] are "1"s, the expression might very well end into "2" (addition) instead of "11" (concatenation). If you need to extract chars 2 and 3 out of the string id, better use the substr() method: id2 = "c" + id.substr(2,2); -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon at internetique.com) Thanks. From hassan at webtuitive.com Sat Apr 12 10:39:06 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sat, 12 Apr 2008 08:39:06 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <27623046.1208008743472.JavaMail.root@m04> <3290855623-1068788042@mail.columbiawireless.ca> Message-ID: <4800D79A.30604@webtuitive.com> David Dorward wrote: > Strings can be treated as character arrays: > > http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:String#Character_access > > However, this isn't a part of JavaScript supported by Internet > Explorer (I think it is new in JS 1.5). Ah, thanks for the reference. The warning on that page that it's a "JavaScript feature" that's not part of the ECMA spec makes me wonder if it's likely to ever be incorporated into IE. But interesting! -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From david at dorward.me.uk Sat Apr 12 10:39:27 2008 From: david at dorward.me.uk (David Dorward) Date: Sat, 12 Apr 2008 16:39:27 +0100 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <4800D690.2040804@internetique.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> Message-ID: <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> On 12 Apr 2008, at 16:34, Claude Schneegans wrote: > > But what's the big idea of breaking a string into its character in > order > to make a string with them? It is a quick and easy way to get at the characters you want from the string. > Especially if those characters are "1" and "1" > If id[2] and id[3] are "1"s, the expression might very well end into > "2" > (addition) instead of "11" (concatenation). Only if there is a bug in the JavaScript engine. The data type is string, you'd have to do something that converted it to a number before that would happen. >>> "123"[1] + "123"[2] "23" > If you need to extract chars 2 and 3 out of the string id, better use > the substr() method: > id2 = "c" + id.substr(2,2); For the sake of IE, this is true, but treating the string as a character array can result in more readable code. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From hassan at webtuitive.com Sat Apr 12 10:43:39 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sat, 12 Apr 2008 08:43:39 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <4800C5AD.5060204@webtuitive.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> Message-ID: <4800D8AB.7070206@webtuitive.com> > though I probably would use a single id.substring(1) I take it back :-) -- in this case I'd just use id2 = id.replace(/q/,'c'); FWIW, -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From tedd at sperling.com Sat Apr 12 11:36:31 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Apr 2008 12:36:31 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) [SOLVED] In-Reply-To: <3290855623-1068788042@mail.columbiawireless.ca> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <27623046.1208008743472.JavaMail.root@m04> <3290855623-1068788042@mail.columbiawireless.ca> Message-ID: At 7:36 AM -0700 4/12/08, Paul Novitski wrote: >At 4/12/2008 06:56 AM, tedd wrote: >> Error: 'document.getElementById(...) is null or not an object. >> >>The offending code is this: >> >>function HideTimedLayer(id) >> { >> document.getElementById(id).style.display = "none"; >> var id2 = 'c' + id[2] + id[3]; >> document.getElementById(id2).checked = true; >> } > > >Tedd, your code above (...id[2] + id[3]...) indicates that the >variable id is an ARRAY. getElementById() takes a STRING as its argument. > >Paul Paul: Your advice is spot on as usual - that WAS the problem. The id I was sending the function was typed as an array when I thought I was providing a string. Thanks a bunch. Cheers, tedd PS: To see what I was working on, take a look at this: http://webbytedd.com/quarters/ Comments? -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Sat Apr 12 12:13:55 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Apr 2008 13:13:55 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> Message-ID: >At 7:22 AM -0700 4/12/08, Hassan Schroeder wrote: >>tedd wrote: >> >>> The offending code is this: >> >>> var id2 = 'c' + id[2] + id[3]; >> >>? I've never seen that shorthand before; do you have a reference to >>JS treating a String as a byte array? > > >No, I don't have a reference -- it's just one of those old habits >from previous languages. In this case, it worked for breaking a >string into its characters. > >It may not work in all cases and was not the reason for failure with >my current problem. I stand corrected -- it was the reason. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From schneegans at internetique.com Sat Apr 12 12:42:38 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Sat, 12 Apr 2008 13:42:38 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> Message-ID: <4800F48E.9070603@internetique.com> >>It is a quick and easy way to get at the characters you want from the string. substr and substring are the appropriate way of doing it. >>Only if there is a bug in the JavaScript engine. The data type is string Actually, Javascript is a typeless language. In C you would be right, but not with Javascript. Sometimes types are guessed by the Javascript machine, and sometimes, it does not guess it the way you would expect. From david at dorward.me.uk Sat Apr 12 13:16:25 2008 From: david at dorward.me.uk (David Dorward) Date: Sat, 12 Apr 2008 19:16:25 +0100 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <4800F48E.9070603@internetique.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> <4800F48E.9070603@internetique.com> Message-ID: <9C1A4DE1-8FDB-44FD-A82A-56BCBDCDE05C@dorward.me.uk> On 12 Apr 2008, at 18:42, Claude Schneegans wrote: > >>> Only if there is a bug in the JavaScript engine. The data type is >>> string > > Actually, Javascript is a typeless language. No, it isn't. It is dynamically typed. > Sometimes types are guessed by the Javascript machine, and > sometimes, it > does not guess it the way you would expect. I've never found it to be less than predictable. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From schneegans at internetique.com Sat Apr 12 14:13:33 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Sat, 12 Apr 2008 15:13:33 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <9C1A4DE1-8FDB-44FD-A82A-56BCBDCDE05C@dorward.me.uk> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> <4800F48E.9070603@internetique.com> <9C1A4DE1-8FDB-44FD-A82A-56BCBDCDE05C@dorward.me.uk> Message-ID: <480109DD.6080307@internetique.com> >>No, it isn't. It is dynamically typed. ... which is about the same thing ;-) Absolute typeless language cannot exist. Obviously, anything must have to end up with some type. This is "dynamically typed", a more accurate way to say the same thing. -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon at internetique.com) Thanks. From kamaleshwar.morjal at gmail.com Sat Apr 12 15:00:00 2008 From: kamaleshwar.morjal at gmail.com (Kamaleshwar Morjal) Date: Sun, 13 Apr 2008 03:00:00 +0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> Message-ID: On Sat, Apr 12, 2008 at 8:25 PM, tedd wrote: > At 2:24 PM -0700 4/11/08, Peter Brunone wrote: > > And please... I'm no Microsoft flunkie, but acting like they're > >singlehandedly holding back the web? That's just a teeny bit silly. > > Not silly at all. > > You said "singlehandedly" -- that reminds me of when Bill Gates was > subpoenaed to appear in front of Congress defending M$ (re monopoly > and predator pricing issues) and said that M$ was only one of several > OS developers. The Congressman asked the audience to hold up their > hand if they used Windows and the entire audience did. The > Congressman replied "Looks like a monopoly to me." (or words to that > affect). > [..... ] > > Just look at the time that css developers waste trying to get > versions of IE to comply -- that's not a minor issue. I could go on, > but what's the point? We ALL have to live with the M$ mistake. > > Cheers, > 100% agreement here.. -- "Best things in the world are free; FREEDOM is priceless!" km -------------- next part -------------- An HTML attachment was scrubbed... URL: From john at jwarner.com Sat Apr 12 16:37:08 2008 From: john at jwarner.com (John Warner) Date: Sat, 12 Apr 2008 17:37:08 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> Message-ID: <034f01c89ce5$5bf8e060$13eaa120$@com> I?m always amazed that it is called wasting time to make your code work with IE. Last I checked IE is 70 to 80% of all browsers out there. What puzzles me is why anyone would set out to code to 30% of browsers and then tweak to fit 70%, seems backwards to me. Like, hate, or whatever MS this just seems backwards to me. Argue all you want about standards or whatever, I live in the real world and try to code accordingly. I?m reminded of the fellow who is standing in the pouring rain cursing the rain, like somehow this will make the rain stop. Get used to it, sometimes it rains, that is the real world. John Warner From: javascript-bounces at lists.evolt.org [mailto:javascript-bounces at lists.evolt.org] On Behalf Of Kamaleshwar Morjal Sent: Saturday, April 12, 2008 4:00 PM To: JavaScript List Subject: Re: [Javascript] IE work-a-round question (re: checkboxes) OT On Sat, Apr 12, 2008 at 8:25 PM, tedd wrote: At 2:24 PM -0700 4/11/08, Peter Brunone wrote: > And please... I'm no Microsoft flunkie, but acting like they're >singlehandedly holding back the web? That's just a teeny bit silly. Not silly at all. You said "singlehandedly" -- that reminds me of when Bill Gates was subpoenaed to appear in front of Congress defending M$ (re monopoly and predator pricing issues) and said that M$ was only one of several OS developers. The Congressman asked the audience to hold up their hand if they used Windows and the entire audience did. The Congressman replied "Looks like a monopoly to me." (or words to that affect). [..... ] Just look at the time that css developers waste trying to get versions of IE to comply -- that's not a minor issue. I could go on, but what's the point? We ALL have to live with the M$ mistake. Cheers, 100% agreement here.. -- "Best things in the world are free; FREEDOM is priceless!" km -------------- next part -------------- An HTML attachment was scrubbed... URL: From schneegans at internetique.com Sat Apr 12 16:58:24 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Sat, 12 Apr 2008 17:58:24 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <034f01c89ce5$5bf8e060$13eaa120$@com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <034f01c89ce5$5bf8e060$13eaa120$@com> Message-ID: <48013080.7020703@internetique.com> >>I?m reminded of the fellow who is standing in the pouring rain cursing the rain, like somehow this will make the rain stop. This is so TRUE ;-) Not even I always develop using IE, but I refused to install IE 7 on my development desktop, what I do must work under IE 6, until everybody switched. I installed IE 7 on my portable, and I check on it if my code is also IE 7 compatible. The advantage is also that when developing for IE first, you can use the Microsoft documentation which is EXCELLENT. The Netscape 4 documentation for Javascript was excellent too, and I still use it. It took years before Mozilla came with some decent documentation, and even now, it looks like a joke. From joel at bizba6.com Sat Apr 12 16:58:19 2008 From: joel at bizba6.com (Joel D Canfield) Date: Sat, 12 Apr 2008 14:58:19 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <034f01c89ce5$5bf8e060$13eaa120$@com> Message-ID: <72E9FAA171D63B48AAC707C72900E6B40110A8F7@ireland.spinhead.com> > What puzzles me is why anyone would set out to code to 30% of browsers > and then tweak to fit 70%, seems backwards to me. what I do is set out to code to standards, then adjust for where browsers don't implement them the way I expected. and if I'm out in the rain and don't have any choice, I'm gonna curse the rain. if I have to spend time tweaking my code for any browser (not just IE) which blatantly disregards logical standards for how things should work, I'm gonna curse the browser. I'll do the work, but I don't see why I have to be happy about it. joel From tedd at sperling.com Sat Apr 12 19:10:55 2008 From: tedd at sperling.com (tedd) Date: Sat, 12 Apr 2008 20:10:55 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <034f01c89ce5$5bf8e060$13eaa120$@com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <034f01c89ce5$5bf8e060$13eaa120$@com> Message-ID: At 5:37 PM -0400 4/12/08, John Warner wrote: >Content-Type: multipart/alternative; > boundary="----=_NextPart_000_0350_01C89CC3.D4E74060" >Content-Language: en-us > >I'm always amazed that it is called wasting time to make your code >work with IE. Last I checked IE is 70 to 80% of all browsers out >there. What puzzles me is why anyone would set out to code to 30% of >browsers and then tweak to fit 70%, seems backwards to me. Like, >hate, or whatever MS this just seems backwards to me. Argue all you >want about standards or whatever, I live in the real world and try >to code accordingly. I'm reminded of the fellow who is standing in >the pouring rain cursing the rain, like somehow this will make the >rain stop. Get used to it, sometimes it rains, that is the real >world. > >John Warner John: I live in the imaginary world where I assume that all browsers comply with standards. However often after testing, I must revisit the real world and adjust my code accordingly because M$ is the last to follow standards. Remember, M$ always has a better idea and that always revolves around control, which usually means "What's in it for M$". Now, don't give me a lecture about how profit is the bottom line for all business because that's not true. The fact is that M$ is big enough to throw it's weight around to make life as difficult as they can for everyone because they want more control of the market -- and that's not because they have a better idea, for they seldom do. The good news is that they are apparently losing control due to competition -- and that's why we are seeing the success of browsers like FireFox, who's beating all IEs in popularity. And why we see languages like php making headway into areas that asp controlled before. Do you JSCRIPT anymore or just write javascript? See what I mean? The days of M$ are NOT over, but their death grip on technology is loosening. Then again, that's my point of view and I live in an imaginary world. In the end, M$ does what they do and I do what I do. I would rather write good clean code (in all languages) that supports standards than do otherwise. YMMV. Cheers, tedd PS: The last time I checked, M$ browsers controlled less than 60% of the market and that number is declining, not increasing. There's hope yet. :-) -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From peter at brunone.com Sat Apr 12 22:11:54 2008 From: peter at brunone.com (Peter Brunone) Date: Sat, 12 Apr 2008 20:11:54 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT Message-ID: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> Not to throw fuel on this particular fire (did you really think you wouldn't start a huge flamey discussion with those comments in the original post?) but if IE still has "60% of the market", how can Firefox be "beating all IEs in popularity"? Joel Spolsky had a great article about the fanatics on both sides of the fence on this issue. It's worth a read, if you have the time: http://joelonsoftware.com/items/2008/03/17.html Cheers, Peter From: tedd tedd at sperling.com At 5:37 PM -0400 4/12/08, John Warner wrote: >Content-Type: multipart/alternative; > boundary="----=_NextPart_000_0350_01C89CC3.D4E74060" >Content-Language: en-us > >I'm always amazed that it is called wasting time to make your code >work with IE. Last I checked IE is 70 to 80% of all browsers out >there. What puzzles me is why anyone would set out to code to 30% of >browsers and then tweak to fit 70%, seems backwards to me. Like, >hate, or whatever MS this just seems backwards to me. Argue all you >want about standards or whatever, I live in the real world and try >to code accordingly. I'm reminded of the fellow who is standing in >the pouring rain cursing the rain, like somehow this will make the >rain stop. Get used to it, sometimes it rains, that is the real >world. > >John Warner John: I live in the imaginary world where I assume that all browsers comply with standards. However often after testing, I must revisit the real world and adjust my code accordingly because M$ is the last to follow standards. Remember, M$ always has a better idea and that always revolves around control, which usually means "What's in it for M$". Now, don't give me a lecture about how profit is the bottom line for all business because that's not true. The fact is that M$ is big enough to throw it's weight around to make life as difficult as they can for everyone because they want more control of the market -- and that's not because they have a better idea, for they seldom do. The good news is that they are apparently losing control due to competition -- and that's why we are seeing the success of browsers like FireFox, who's beating all IEs in popularity. And why we see languages like php making headway into areas that asp controlled before. Do you JSCRIPT anymore or just write javascript? See what I mean? The days of M$ are NOT over, but their death grip on technology is loosening. Then again, that's my point of view and I live in an imaginary world. In the end, M$ does what they do and I do what I do. I would rather write good clean code (in all languages) that supports standards than do otherwise. YMMV. Cheers, tedd PS: The last time I checked, M$ browsers controlled less than 60% of the market and that number is declining, not increasing. There's hope yet. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From kamaleshwar.morjal at gmail.com Sun Apr 13 01:43:59 2008 From: kamaleshwar.morjal at gmail.com (Kamaleshwar Morjal) Date: Sun, 13 Apr 2008 13:43:59 +0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> References: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> Message-ID: On Sun, Apr 13, 2008 at 10:11 AM, Peter Brunone wrote: > > Not to throw fuel on this particular fire (did you really think you > wouldn't start a huge flamey discussion with those comments in the original > post?) but if IE still has "60% of the market", how can Firefox be "beating > all IEs in popularity"? > Joel Spolsky had a great article about the fanatics on both sides of > the fence on this issue. It's worth a read, if you have the time: > http://joelonsoftware.com/items/2008/03/17.html > > Cheers, > > Peter > Hmmm.. "What the hell is a standard?" Well, whatever it be.. If everyone choses to follow it, it can be improvised for everyone's benefit. BUT! Imagine a world where every browser mfr has "their own standard". Imagine a world where every browser manufacturer has the M$ mentality!! What do you see beyond that?? I can only see unmanageable, unimaginable chaos! Cheers! { hoping people always tend to move towards 'something' called global standards, rather than their own "what's-in-it-for-me"-motivated-standards } PS(1): By the way, anyone and everyone around me uses anything but IE.. One more valid point for me being IE is not available for the OS i and my friends use. Most other 'preferable' (according to us) browsers are available on all platforms that we use (including M$ windoze). All IE-boys out there should rather accept now that the world does not end at windoze. PS(2): My opinion does not, in any way, seem biased to me; rather logical. Because I believe in having a choice rather than letting someone else control every aspect of my computing experience. And the numbers of people like me are "rising" with increasing "awareness". +ve trait, i believe ;) cheers again.. :o) > > *From*: tedd tedd at sperling.com > > At 5:37 PM -0400 4/12/08, John Warner wrote: > >Content-Type: multipart/alternative; > > boundary="----=_NextPart_000_0350_01C89CC3.D4E74060" > >Content-Language: en-us > > > >I'm always amazed that it is called wasting time to make your code > >work with IE. Last I checked IE is 70 to 80% of all browsers out > >there. What puzzles me is why anyone would set out to code to 30% of > >browsers and then tweak to fit 70%, seems backwards to me. Like, > >hate, or whatever MS this just seems backwards to me. Argue all you > >want about standards or whatever, I live in the real world and try > >to code accordingly. I'm reminded of the fellow who is standing in > >the pouring rain cursing the rain, like somehow this will make the > >rain stop. Get used to it, sometimes it rains, that is the real > >world. > > > >John Warner > > > John: > > I live in the imaginary world where I assume that all browsers comply > with standards. > > However often after testing, I must revisit the real world and adjust > my code accordingly because M$ is the last to follow standards. > Remember, M$ always has a better idea and that always revolves around > control, which usually means "What's in it for M$". > > Now, don't give me a lecture about how profit is the bottom line for > all business because that's not true. The fact is that M$ is big > enough to throw it's weight around to make life as difficult as they > can for everyone because they want more control of the market -- and > that's not because they have a better idea, for they seldom do. > > The good news is that they are apparently losing control due to > competition -- and that's why we are seeing the success of browsers > like FireFox, who's beating all IEs in popularity. And why we see > languages like php making headway into areas that asp controlled > before. Do you JSCRIPT anymore or just write javascript? See what I > mean? > > The days of M$ are NOT over, but their death grip on technology is > loosening. Then again, that's my point of view and I live in an > imaginary world. > > In the end, M$ does what they do and I do what I do. I would rather > write good clean code (in all languages) that supports standards than > do otherwise. YMMV. > > Cheers, > > tedd > > PS: The last time I checked, M$ browsers controlled less than 60% of > the market and that number is declining, not increasing. There's hope > yet. :-) > > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript > -- km -------------- next part -------------- An HTML attachment was scrubbed... URL: From john at jwarner.com Sun Apr 13 05:43:51 2008 From: john at jwarner.com (John Warner) Date: Sun, 13 Apr 2008 06:43:51 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <72E9FAA171D63B48AAC707C72900E6B40110A8F7@ireland.spinhead.com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <034f01c89ce5$5bf8e060$13eaa120$@com> <72E9FAA171D63B48AAC707C72900E6B40110A8F7@ireland.spinhead.com> Message-ID: <036901c89d53$440ce000$cc26a000$@com> You don't actually like your users do you. They are just a necessary evil in the process? John Warner > -----Original Message----- > From: javascript-bounces at lists.evolt.org [mailto:javascript- > bounces at lists.evolt.org] On Behalf Of Joel D Canfield > Sent: Saturday, April 12, 2008 5:58 PM > To: JavaScript List > Subject: Re: [Javascript] IE work-a-round question (re: checkboxes) OT > > > What puzzles me is why anyone would set out to code to 30% of browsers > > and then tweak to fit 70%, seems backwards to me. > > what I do is set out to code to standards, then adjust for where > browsers don't implement them the way I expected. > > and if I'm out in the rain and don't have any choice, I'm gonna curse > the rain. if I have to spend time tweaking my code for any browser (not > just IE) which blatantly disregards logical standards for how things > should work, I'm gonna curse the browser. I'll do the work, but I don't > see why I have to be happy about it. > > joel > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript From john at jwarner.com Sun Apr 13 05:46:45 2008 From: john at jwarner.com (John Warner) Date: Sun, 13 Apr 2008 06:46:45 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: References: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> Message-ID: <036a01c89d53$ab3ff140$01bfd3c0$@com> Imagine a world where developers think the user is king and develop for the user?s benefit instead of stroking their own ego. Learn to love your users and accept what they toss at you. Right now users are 70% or so of the time tossing some form of IE at you. What are standards indeed. In the US we have a Constitution, NO ONE can agree on what it means. John Warner From: javascript-bounces at lists.evolt.org [mailto:javascript-bounces at lists.evolt.org] On Behalf Of Kamaleshwar Morjal Sent: Sunday, April 13, 2008 2:44 AM To: JavaScript List Subject: Re: [Javascript] IE work-a-round question (re: checkboxes) OT On Sun, Apr 13, 2008 at 10:11 AM, Peter Brunone wrote: Not to throw fuel on this particular fire (did you really think you wouldn't start a huge flamey discussion with those comments in the original post?) but if IE still has "60% of the market", how can Firefox be "beating all IEs in popularity"? Joel Spolsky had a great article about the fanatics on both sides of the fence on this issue. It's worth a read, if you have the time: http://joelonsoftware.com/items/2008/03/17.html Cheers, Peter Hmmm.. "What the hell is a standard?" Well, whatever it be.. If everyone choses to follow it, it can be improvised for everyone's benefit. BUT! Imagine a world where every browser mfr has "their own standard". Imagine a world where every browser manufacturer has the M$ mentality!! What do you see beyond that?? I can only see unmanageable, unimaginable chaos! Cheers! { hoping people always tend to move towards 'something' called global standards, rather than their own "what's-in-it-for-me"-motivated-standards } PS(1): By the way, anyone and everyone around me uses anything but IE.. One more valid point for me being IE is not available for the OS i and my friends use. Most other 'preferable' (according to us) browsers are available on all platforms that we use (including M$ windoze). All IE-boys out there should rather accept now that the world does not end at windoze. PS(2): My opinion does not, in any way, seem biased to me; rather logical. Because I believe in having a choice rather than letting someone else control every aspect of my computing experience. And the numbers of people like me are "rising" with increasing "awareness". +ve trait, i believe ;) cheers again.. :o) From: tedd tedd at sperling.com At 5:37 PM -0400 4/12/08, John Warner wrote: >Content-Type: multipart/alternative; > boundary="----=_NextPart_000_0350_01C89CC3.D4E74060" >Content-Language: en-us > >I'm always amazed that it is called wasting time to make your code >work with IE. Last I checked IE is 70 to 80% of all browsers out >there. What puzzles me is why anyone would set out to code to 30% of >browsers and then tweak to fit 70%, seems backwards to me. Like, >hate, or whatever MS this just seems backwards to me. Argue all you >want about standards or whatever, I live in the real world and try >to code accordingly. I'm reminded of the fellow who is standing in >the pouring rain cursing the rain, like somehow this will make the >rain stop. Get used to it, sometimes it rains, that is the real >world. > >John Warner John: I live in the imaginary world where I assume that all browsers comply with standards. However often after testing, I must revisit the real world and adjust my code accordingly because M$ is the last to follow standards. Remember, M$ always has a better idea and that always revolves around control, which usually means "What's in it for M$". Now, don't give me a lecture about how profit is the bottom line for all business because that's not true. The fact is that M$ is big enough to throw it's weight around to make life as difficult as they can for everyone because they want more control of the market -- and that's not because they have a better idea, for they seldom do. The good news is that they are apparently losing control due to competition -- and that's why we are seeing the success of browsers like FireFox, who's beating all IEs in popularity. And why we see languages like php making headway into areas that asp controlled before. Do you JSCRIPT anymore or just write javascript? See what I mean? The days of M$ are NOT over, but their death grip on technology is loosening. Then again, that's my point of view and I live in an imaginary world. In the end, M$ does what they do and I do what I do. I would rather write good clean code (in all languages) that supports standards than do otherwise. YMMV. Cheers, tedd PS: The last time I checked, M$ browsers controlled less than 60% of the market and that number is declining, not increasing. There's hope yet. :-) _______________________________________________ Javascript mailing list Javascript at lists.evolt.org http://lists.evolt.org/mailman/listinfo/javascript -- km -------------- next part -------------- An HTML attachment was scrubbed... URL: From john at jwarner.com Sun Apr 13 05:46:45 2008 From: john at jwarner.com (John Warner) Date: Sun, 13 Apr 2008 06:46:45 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: References: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> Message-ID: <036a01c89d53$ab3ff140$01bfd3c0$@com> Imagine a world where developers think the user is king and develop for the user?s benefit instead of stroking their own ego. Learn to love your users and accept what they toss at you. Right now users are 70% or so of the time tossing some form of IE at you. What are standards indeed. In the US we have a Constitution, NO ONE can agree on what it means. John Warner From: javascript-bounces at lists.evolt.org [mailto:javascript-bounces at lists.evolt.org] On Behalf Of Kamaleshwar Morjal Sent: Sunday, April 13, 2008 2:44 AM To: JavaScript List Subject: Re: [Javascript] IE work-a-round question (re: checkboxes) OT On Sun, Apr 13, 2008 at 10:11 AM, Peter Brunone wrote: Not to throw fuel on this particular fire (did you really think you wouldn't start a huge flamey discussion with those comments in the original post?) but if IE still has "60% of the market", how can Firefox be "beating all IEs in popularity"? Joel Spolsky had a great article about the fanatics on both sides of the fence on this issue. It's worth a read, if you have the time: http://joelonsoftware.com/items/2008/03/17.html Cheers, Peter Hmmm.. "What the hell is a standard?" Well, whatever it be.. If everyone choses to follow it, it can be improvised for everyone's benefit. BUT! Imagine a world where every browser mfr has "their own standard". Imagine a world where every browser manufacturer has the M$ mentality!! What do you see beyond that?? I can only see unmanageable, unimaginable chaos! Cheers! { hoping people always tend to move towards 'something' called global standards, rather than their own "what's-in-it-for-me"-motivated-standards } PS(1): By the way, anyone and everyone around me uses anything but IE.. One more valid point for me being IE is not available for the OS i and my friends use. Most other 'preferable' (according to us) browsers are available on all platforms that we use (including M$ windoze). All IE-boys out there should rather accept now that the world does not end at windoze. PS(2): My opinion does not, in any way, seem biased to me; rather logical. Because I believe in having a choice rather than letting someone else control every aspect of my computing experience. And the numbers of people like me are "rising" with increasing "awareness". +ve trait, i believe ;) cheers again.. :o) From: tedd tedd at sperling.com At 5:37 PM -0400 4/12/08, John Warner wrote: >Content-Type: multipart/alternative; > boundary="----=_NextPart_000_0350_01C89CC3.D4E74060" >Content-Language: en-us > >I'm always amazed that it is called wasting time to make your code >work with IE. Last I checked IE is 70 to 80% of all browsers out >there. What puzzles me is why anyone would set out to code to 30% of >browsers and then tweak to fit 70%, seems backwards to me. Like, >hate, or whatever MS this just seems backwards to me. Argue all you >want about standards or whatever, I live in the real world and try >to code accordingly. I'm reminded of the fellow who is standing in >the pouring rain cursing the rain, like somehow this will make the >rain stop. Get used to it, sometimes it rains, that is the real >world. > >John Warner John: I live in the imaginary world where I assume that all browsers comply with standards. However often after testing, I must revisit the real world and adjust my code accordingly because M$ is the last to follow standards. Remember, M$ always has a better idea and that always revolves around control, which usually means "What's in it for M$". Now, don't give me a lecture about how profit is the bottom line for all business because that's not true. The fact is that M$ is big enough to throw it's weight around to make life as difficult as they can for everyone because they want more control of the market -- and that's not because they have a better idea, for they seldom do. The good news is that they are apparently losing control due to competition -- and that's why we are seeing the success of browsers like FireFox, who's beating all IEs in popularity. And why we see languages like php making headway into areas that asp controlled before. Do you JSCRIPT anymore or just write javascript? See what I mean? The days of M$ are NOT over, but their death grip on technology is loosening. Then again, that's my point of view and I live in an imaginary world. In the end, M$ does what they do and I do what I do. I would rather write good clean code (in all languages) that supports standards than do otherwise. YMMV. Cheers, tedd PS: The last time I checked, M$ browsers controlled less than 60% of the market and that number is declining, not increasing. There's hope yet. :-) _______________________________________________ Javascript mailing list Javascript at lists.evolt.org http://lists.evolt.org/mailman/listinfo/javascript -- km -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Sun Apr 13 07:00:34 2008 From: tedd at sperling.com (tedd) Date: Sun, 13 Apr 2008 08:00:34 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> References: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> Message-ID: At 8:11 PM -0700 4/12/08, Peter Brunone wrote: > but if IE still has "60% of the market", how can Firefox be >"beating all IEs in popularity"? Statistics vary depending upon source, but all that I've seen show FF with a higher percentage of users than any of the three IE's (IE5, IE6, and IE7). However, if you total all the IE users, then that figure tops out at about 60 percent. That's what I meant by saying that FF is beating all IE's in popularity AND what's more important is that figure is increasing. Except for IE7, all other IE's are losing ground while all other browsers are gaining market share. I think users are starting to wise-up and realize that M$ isn't their only option. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Sun Apr 13 07:47:47 2008 From: tedd at sperling.com (tedd) Date: Sun, 13 Apr 2008 08:47:47 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <036a01c89d53$ab3ff140$01bfd3c0$@com> References: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> <036a01c89d53$ab3ff140$01bfd3c0$@com> Message-ID: At 6:46 AM -0400 4/13/08, John Warner wrote: >Content-Type: multipart/alternative; > boundary="----=_NextPart_000_036B_01C89D32.242E5140" >Content-Language: en-us > >Imagine a world where developers think the user is king and develop >for the user's benefit instead of stroking their own ego. Learn to >love your users and accept what they toss at you. Right now users >are 70% or so of the time tossing some form of IE at you. What are >standards indeed. In the US we have a Constitution, NO ONE can agree >on what it means. > John: My clients are my focus and I do everything I can to meet their needs. Their needs having nothing to do with M$, but rather with selling their goods and services on the net. It's my charge is to see what they sell reaches the largest audience possible. It has nothing to do with ego, but rather with service. M$ is just another difficulty that we all have to live with BUT M$ does not control things. My clients and I have other choices. I was an Apple supporter long before there was even M$ and I haven't seen a single feature that M$ did better. Granted the general majority of Internet users use M$ products, but that is relative depending upon the sites they visit. For example, I have one site where the visitors for the last year fall into these numbers: Safari 27,686 Firefox 1,700 Camino 698 IE 145 <-- less than 1/2 of one percent Mozilla 113 Now clearly, IE's don't rule there, do they? One of the interesting things about this site (not meaning to promote it), but Macintosh users can easily access it -- they just type option v dot com, but IE users have difficulty doing that. It's just another example of how IE falls short on global needs (IDNS). It's those type of shortsighted decisions that are hurting M$ and it's their ego that won't allow them to realize that. Whereas, Apple has seen the global market and knows that it is the key to long term growth -- last year Apple made more money overseas than they did domestically. Standards like W3C, Unicode, and accessibility should be seriously considered because following them provides the widest possible access to customers for your clients -- and that's what this is all about. Cheers, tedd PS: Don't even get me started on the US Constitution and this government's one party system. :-) -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From hassan at webtuitive.com Sun Apr 13 09:35:18 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Sun, 13 Apr 2008 07:35:18 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <036a01c89d53$ab3ff140$01bfd3c0$@com> References: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> <036a01c89d53$ab3ff140$01bfd3c0$@com> Message-ID: <48021A26.5080708@webtuitive.com> John Warner wrote: > What are standards indeed. In the late '80s Sun Microsystems began sponsoring an event called 'Connectathon', where networking engineers gathered to test the interoperability of their TCP/IP stacks and iron out differences in a controlled, cooperative setting. When's the last time you wondered if you were going to be able to, say, successfully FTP a file from a Windows box to a *nix box? At one time it wasn't a given, but /having a standard/ *and* having all the networking vendors actively involved in addressing ambiguities or omissions in the standard made the Internet of today possible. > Imagine a world where developers think the user is king and develop for > the user?s benefit instead of stroking their own ego. Imagine a world where developers spend 100% of their time focused on *creating value* for their clients/users, instead of diverting a substantial portion to accomodating differences between browsers' implementations of (or indifference to) standards. Sorry, can't resist: Note: appreciating the link above doesn't make me anti-Microsoft, but anti-indifference-to-standards :-) The whole area of mobile phone browsers, for instance, is another standards train wreck... -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From joel at bizba6.com Sun Apr 13 10:41:28 2008 From: joel at bizba6.com (Joel D Canfield) Date: Sun, 13 Apr 2008 08:41:28 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <034f01c89ce5$5bf8e060$13eaa120$@com><72E9FAA171D63B48AAC707C72900E6B40110A8F7@ireland.spinhead.com> <036901c89d53$440ce000$cc26a000$@com> Message-ID: <72E9FAA171D63B48AAC707C72900E6B40110A8FA@ireland.spinhead.com> > You don't actually like your users do you. They are just a > necessary evil > in the process? I can't even imagine where you got that from. What I wrote was "I code to spec, then adjust for exceptions." Please don't try to explain. joel From schneegans at internetique.com Sun Apr 13 11:12:43 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Sun, 13 Apr 2008 12:12:43 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> References: <1fb659bb76bf425294fac232caac04ba@maila15.webcontrolcenter.com> Message-ID: <480230FB.2080800@internetique.com> >>if IE still has "60% of the market", how can Firefox be "beating all IEs in popularity"? Easy: those two statistics do not extract data form the same population. Browser use is measured counting hits on sites, with no discrimination. Browser popularity is measured from what users say about it. The difference is that most Mozilla users are competent enough to go to the Firefox site, download it and install it. From there, they can also participate to forums, answer surveys about how they like it and hate IE. On the other side, many IE users use IE because it is the default option coming with Windows, it is what's get opened when they click (most of the time by accident) on a link in a message they get in Outlook. Most of them don't know they use IE, and don't even know what a browser is. So don't ask them if they like it or not ;-) From schneegans at internetique.com Sun Apr 13 11:16:46 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Sun, 13 Apr 2008 12:16:46 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <036901c89d53$440ce000$cc26a000$@com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <034f01c89ce5$5bf8e060$13eaa120$@com> <72E9FAA171D63B48AAC707C72900E6B40110A8F7@ireland.spinhead.com> <036901c89d53$440ce000$cc26a000$@com> Message-ID: <480231EE.80403@internetique.com> >>You don't actually like your users do you. What a dummy comment! Why making sure a site working well for 70% of visitors first, 30% then, would mean he doesn't like his users? What would you do if you like them? Force them to install Firefox? -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon at internetique.com) Thanks. From steveax at pobox.com Sun Apr 13 18:11:36 2008 From: steveax at pobox.com (Steve Axthelm) Date: Sun, 13 Apr 2008 16:11:36 -0700 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <480231EE.80403@internetique.com> Message-ID: I'd like to respectfully suggest that this thread no longer has anything to do with javascript and that those interested in browser wars take the discussion off list. TIA, -Steve -- Steve Axthelm steveax at pobox.com From scott at randomchaos.com Sun Apr 13 19:06:30 2008 From: scott at randomchaos.com (Scott Reynen) Date: Sun, 13 Apr 2008 18:06:30 -0600 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: References: Message-ID: <082A6973-2D35-4D0C-B5B4-39E9239B6408@randomchaos.com> On Apr 13, 2008, at 5:11 PM, Steve Axthelm wrote: > I'd like to respectfully suggest that this thread no longer has > anything to do with javascript and that those interested in > browser wars take the discussion off list. Seconded. Peace, Scott From skip at bigskypenguin.com Tue Apr 15 20:18:47 2008 From: skip at bigskypenguin.com (Skip Evans) Date: Tue, 15 Apr 2008 20:18:47 -0500 Subject: [Javascript] IE onclick problem Message-ID: <480553F7.4090108@bigskypenguin.com> Hey all, I'm having a problem using onclick in HTML files with IE 6 and 7. It works fine in Firefox, but not IE. Both of them get an error, typically "Object expected." I use the following in HTML files: Add Player Can someone tell me how I can make this work in IE, or offer some sort of alternative? I've been searching Google and reading up on the problem but have not found a solution yet. Thanks! Skip -- Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madison, WI 53703 608-250-2720 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL, AJAX & DHTML development framework. http://phpenguin.bigskypenguin.com/ From java.script at cutterscrossing.com Tue Apr 15 20:25:12 2008 From: java.script at cutterscrossing.com (Cutter (JSRelated)) Date: Tue, 15 Apr 2008 20:25:12 -0500 Subject: [Javascript] IE onclick problem In-Reply-To: <480553F7.4090108@bigskypenguin.com> References: <480553F7.4090108@bigskypenguin.com> Message-ID: <48055578.3010709@cutterscrossing.com> You wouldn't do onclick="return addPlayer()", but rather just onclick="addPlayer()". Not unless there was a really valid reason for doing so. If I had to guess, your addPlayer() method is at issue here, with some internal functionality that is breaking because it isn't properly written for cross browser implementation. Steve "Cutter" Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _____________________________ http://blog.cutterscrossing.com From skip at bigskypenguin.com Tue Apr 15 20:44:25 2008 From: skip at bigskypenguin.com (Skip Evans) Date: Tue, 15 Apr 2008 20:44:25 -0500 Subject: [Javascript] IE onclick problem In-Reply-To: <48055578.3010709@cutterscrossing.com> References: <480553F7.4090108@bigskypenguin.com> <48055578.3010709@cutterscrossing.com> Message-ID: <480559F9.6070007@bigskypenguin.com> Hey Cutter & all, I tried doing as you have below, without the return, but that didn't work either. I also placed an alert at the very top of the JS function addPlayer, but it never shows, so I'm thinking that it never reaches the function. But I will keep looking into the addPlayer function as you suggest. Any other ideas would be greatly appreciated. Thanks, Skip Cutter (JSRelated) wrote: > You wouldn't do onclick="return addPlayer()", but rather just > onclick="addPlayer()". Not unless there was a really valid reason for > doing so. If I had to guess, your addPlayer() method is at issue here, > with some internal functionality that is breaking because it isn't > properly written for cross browser implementation. > > Steve "Cutter" Blades > Adobe Certified Professional > Advanced Macromedia ColdFusion MX 7 Developer > _____________________________ > http://blog.cutterscrossing.com > > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript > -- Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madison, WI 53703 608-250-2720 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL, AJAX & DHTML development framework. http://phpenguin.bigskypenguin.com/ From trojani2000 at hotmail.com Wed Apr 16 00:02:07 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Wed, 16 Apr 2008 05:02:07 +0000 Subject: [Javascript] IE work-a-round question (re: checkboxes) In-Reply-To: <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> Message-ID: Yeah, so was the IE, direct element refferencing, a decade older than W3C document.getElementById(MyElement).style.something. It was more readable, more easy, more flexy, more reliable, more everything... by simply stating: MyElement.style.smashIt, but what happened? tell Tedd who was holding back the WEB. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: david at dorward.me.uk> To: javascript at lists.evolt.org> Date: Sat, 12 Apr 2008 16:39:27 +0100> Subject: Re: [Javascript] IE work-a-round question (re: checkboxes)> > > On 12 Apr 2008, at 16:34, Claude Schneegans wrote:> >> > But what's the big idea of breaking a string into its character in > > order> > to make a string with them?> > It is a quick and easy way to get at the characters you want from the > string.> > > Especially if those characters are "1" and "1"> > If id[2] and id[3] are "1"s, the expression might very well end into > > "2"> > (addition) instead of "11" (concatenation).> > Only if there is a bug in the JavaScript engine. The data type is > string, you'd have to do something that converted it to a number > before that would happen.> > >>> "123"[1] + "123"[2]> "23"> > > If you need to extract chars 2 and 3 out of the string id, better use> > the substr() method:> > id2 = "c" + id.substr(2,2);> > > For the sake of IE, this is true, but treating the string as a > character array can result in more readable code.> > -- > David Dorward> http://dorward.me.uk/> http://blog.dorward.me.uk/> > > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Pack up or back up?use SkyDrive to transfer files or keep extra copies. Learn how. http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From schneegans at internetique.com Wed Apr 16 00:39:04 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Wed, 16 Apr 2008 01:39:04 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <480553F7.4090108@bigskypenguin.com> References: <480553F7.4090108@bigskypenguin.com> Message-ID: <480590F8.4070109@internetique.com> You must have something else in your code which causes the trouble. This works every click for me (IE 6) Add Player Have you "Notification for Javascript errors" enabled? If you have any compilation error in you javascript in your page, it will cease executing. From trojani2000 at hotmail.com Wed Apr 16 02:57:43 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Wed, 16 Apr 2008 07:57:43 +0000 Subject: [Javascript] IE onclick problem In-Reply-To: <480590F8.4070109@internetique.com> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> Message-ID: What does the "return" statement stand for?!! I've never used it. Neither did I happen to come to the situation that I would be forced to do so. -So, than, why is it standing there? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Date: Wed, 16 Apr 2008 01:39:04 -0400> From: schneegans at internetique.com> To: javascript at lists.evolt.org> Subject: Re: [Javascript] IE onclick problem> > You must have something else in your code which causes the trouble.> This works every click for me (IE 6)> > Add Player> > > Have you "Notification for Javascript errors" enabled?> If you have any compilation error in you javascript in your page, it > will cease executing.> > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Going green? See the top 12 foods to eat organic. http://green.msn.com/galleries/photos/photos.aspx?gid=164&ocid=T003MSN51N1653A -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at dorward.me.uk Wed Apr 16 03:46:42 2008 From: david at dorward.me.uk (David Dorward) Date: Wed, 16 Apr 2008 09:46:42 +0100 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> Message-ID: <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> On 16 Apr 2008, at 08:57, Troy III Ajnej wrote: > > Add Player > What does the "return" statement stand for?!! I've never used it. > Neither did I happen to come to the situation that I would be forced > to do so. -So, than, why is it standing there? Assuming it is written sensibly, the addPlayer function will return either a true or false value depending on the success of its attempt to run. By capturing that value and returning it from the event handler, the fallback mechanism (BTW, href="#" is a link to the top of the page ... which is a dreadful fallback mechanism) can be allowed to run or be cancelled. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From david at dorward.me.uk Wed Apr 16 03:59:11 2008 From: david at dorward.me.uk (David Dorward) Date: Wed, 16 Apr 2008 09:59:11 +0100 Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkboxes)) In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> Message-ID: On 16 Apr 2008, at 06:02, Troy III Ajnej wrote: > Yeah, so was the IE, direct element refferencing Generating global variables, which might conflict with built ins, simply by associating an HTML document with a JavaScript program is a good way to generate confusing bugs during development and make maintenance a pain. > , a decade older than W3C > document.getElementById(MyElement).style.something. Internet Explorer 1.0 was released in 1995 JavaScript was first seen on the web in 1996 Internet Explorer 3.0 arrived in 1996 and was the first version to include support for client side scripting. DOM 1 reached recommendation status in 1998 Where does this "decade" fit in? > It was more readable, more easy, more flexy, more reliable, more > everything... > by simply stating: MyElement.style.smashIt, but what happened? It lent itself to write-only code, they didn't consult with anyone before implementing it, the standards group (including Microsoft) came up with something better. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From schneegans at internetique.com Wed Apr 16 08:41:32 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Wed, 16 Apr 2008 09:41:32 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> Message-ID: <4806020C.80902@internetique.com> >>What does the "return" statement stand for? If the function returns false, the event will be canceled. Use it for instance in a submit button for some validation function. If validation fails, return false, and the submit is canceled. In the previous example, the link to the top of the current page will be canceled, so the scrolled position won't change. From trojani2000 at hotmail.com Wed Apr 16 19:28:53 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Thu, 17 Apr 2008 00:28:53 +0000 Subject: [Javascript] IE onclick problem In-Reply-To: <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> Message-ID: Yes, but how do you hadle it, -how do you capture the bolean response of true or false in case it fails to run, or in casse it succeeded, how do you check it prior to invoking other instuctions? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: david at dorward.me.uk> To: javascript at lists.evolt.org> Date: Wed, 16 Apr 2008 09:46:42 +0100> Subject: Re: [Javascript] IE onclick problem> > > On 16 Apr 2008, at 08:57, Troy III Ajnej wrote:> > > > Add Player> > > > What does the "return" statement stand for?!! I've never used it.> > Neither did I happen to come to the situation that I would be forced> > to do so. -So, than, why is it standing there?> > > Assuming it is written sensibly, the addPlayer function will return > either a true or false value depending on the success of its attempt > to run. By capturing that value and returning it from the event > handler, the fallback mechanism (BTW, href="#" is a link to the top of > the page ... which is a dreadful fallback mechanism) can be allowed to > run or be cancelled.> > > -- > David Dorward> http://dorward.me.uk/> http://blog.dorward.me.uk/> > > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Get in touch in an instant. Get Windows Live Messenger now. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_getintouch_042008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From java.script at cutterscrossing.com Wed Apr 16 20:22:03 2008 From: java.script at cutterscrossing.com (Cutter (JSRelated)) Date: Wed, 16 Apr 2008 20:22:03 -0500 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> Message-ID: <4806A63B.5010007@cutterscrossing.com> That's the point, in this case/usage you don't. Here's what I mean. It's exactly like doing form validation. You have a form.submit() event, which you override in some way by saying "do all of this. Oh wait, that failed, so we have to stop." Your validation methods return false to the submit method itself, stopping it from performing it's default 'submit' action. Or, your validation methods all return true, ultimately passing that to the 'submit' event, allowing it to complete it's default action. The 'click' handler works the same way. By specifying 'true' or 'false' in your onclick attribute, you are just telling the click event whether it should do it's default 'click' action, or just stop right there. Any logic/process/programmatic magic you are doing (or want to do) should happen, then return a true or false to the click handler so that it knows to stop or continue. This is why I started using JQuery. Makes these things really simple. Steve "Cutter" Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _____________________________ http://blog.cutterscrossing.com Troy III Ajnej wrote: > Yes, > but how do you hadle it, -how do you capture the bolean response > of true or false in case it fails to run, or in casse it succeeded, how > do you check it prior to invoking other instuctions? > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Troy III > progressive art enterprise > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > ------------------------------------------------------------------------ > > > From: david at dorward.me.uk > > To: javascript at lists.evolt.org > > Date: Wed, 16 Apr 2008 09:46:42 +0100 > > Subject: Re: [Javascript] IE onclick problem > > > > > > On 16 Apr 2008, at 08:57, Troy III Ajnej wrote: > > > > > > Add Player > > > > > > > What does the "return" statement stand for?!! I've never used it. > > > Neither did I happen to come to the situation that I would be forced > > > to do so. -So, than, why is it standing there? > > > > > > Assuming it is written sensibly, the addPlayer function will return > > either a true or false value depending on the success of its attempt > > to run. By capturing that value and returning it from the event > > handler, the fallback mechanism (BTW, href="#" is a link to the top of > > the page ... which is a dreadful fallback mechanism) can be allowed to > > run or be cancelled. > > > > > > -- > > David Dorward > > http://dorward.me.uk/ > > http://blog.dorward.me.uk/ > > > > > > _______________________________________________ > > Javascript mailing list > > Javascript at lists.evolt.org > > http://lists.evolt.org/mailman/listinfo/javascript > > > ------------------------------------------------------------------------ > Get in touch in an instant. Get Windows Live Messenger now. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript From schneegans at internetique.com Wed Apr 16 20:38:35 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Wed, 16 Apr 2008 21:38:35 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> Message-ID: <4806AA1B.8020502@internetique.com> >>Yes, but how do you hadle it, -how do you capture the bolean response of true or false in case it fails to run, or in casse it succeeded, how do you check it prior to invoking other instuctions? Well, you don't "capture the bolean response", the browser takes care of it. When an event handler returns, the event is passed to the next event handler for the event. This is called bubbling, but if an event returns false, the process is stopped. Since all onsubmit events are processed before the submit itself, if one of them returns false, the submit is actually not executed. Ex:
................
if there is an invalid field, the function displays the message, returns false, and the submit is cancelled, otherwise, the form is submitted normally. From lester at denhaag.org Wed Apr 16 20:56:58 2008 From: lester at denhaag.org (J. Lester Novros II) Date: Thu, 17 Apr 2008 03:56:58 +0200 Subject: [Javascript] IE onclick problem In-Reply-To: <4806AA1B.8020502@internetique.com> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <4806AA1B.8020502@internetique.com> Message-ID: <4806AE6A.6010506@denhaag.org> Claude Schneegans wrote: >
> ................ >
> Um... At the risk of sounding pedantic, isn't the whole point of this thread that one should use return statements in the handler function rather than in the event handler itself? So I would argue that 'onsubmit="return checkMyForm()"' should read 'onsubmit="checkMyForm()"' since the handler function itself returns a true or false value to the onsubmit event, thereby cancelling or granting the submit event. Just my 0.02 Eur. l8R lES -- "I think a lot more of Apple than I do of MSFT, but then I'd rather catch rabies than AIDS..." /. comment http://www.supermarionation.tv From trojani2000 at hotmail.com Wed Apr 16 21:07:30 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Thu, 17 Apr 2008 02:07:30 +0000 Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkbox In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> Message-ID: I still don't see "MyElement" shorthand anywhere (1997-2008 == more than a decade). > Generating global variables, which might conflict with built ins, > simply by associating an HTML document with a JavaScript program is a > good way to generate confusing bugs during development and make > maintenance a pain. I don't see how could a refference to the doc element have to do anything with associating HTML with Javascript or messing anything else up! > DOM 1 reached recommendation status in 1998 Sorry but I don't recall if it's first recommendation included the "document.getElemen..." statement in its apearence. It was DOM Level 2 that invented e different statement for the same purpose and reached recommendation status only a month before 2001. Almost 3 years after referencing element by ID has become a true empiricall standard for coders around the world. W3C did everything to avoid adapting this exellent syntax, simply because it was an IE invention. Eventhough FX didn't hesitate to implement it, but did it maliciously. Same goes with the famous .innerHTML. > It lent itself to write-only code, they didn't consult with anyone > before implementing it, the standards group (including Microsoft) came > up with something better. :) Like What? And what do you understand with "write-only"? What do you mean with "they didn't consult with anyone"? Do you understand that this acusation is a direct answer to the question: -Who was, and still is hollding up the web??? Don't forget that it was only in December 1997 that HTML 4.0 added support for tables. Can you imagine? -Tables! W3C recommended "document.getElement" a month before 2001, while IE4-was allready three years old and running. So it was, still is, and allways will be, W3C. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: david at dorward.me.uk> To: javascript at lists.evolt.org> Date: Wed, 16 Apr 2008 09:59:11 +0100> Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkboxes))> > > On 16 Apr 2008, at 06:02, Troy III Ajnej wrote:> > Yeah, so was the IE, direct element refferencing> > Generating global variables, which might conflict with built ins, > simply by associating an HTML document with a JavaScript program is a > good way to generate confusing bugs during development and make > maintenance a pain.> > > , a decade older than W3C > > document.getElementById(MyElement).style.something.> > Internet Explorer 1.0 was released in 1995> > JavaScript was first seen on the web in 1996> > Internet Explorer 3.0 arrived in 1996 and was the first version to > include support for client side scripting.> > DOM 1 reached recommendation status in 1998> > Where does this "decade" fit in?> > > It was more readable, more easy, more flexy, more reliable, more > > everything...> > by simply stating: MyElement.style.smashIt, but what happened?> > It lent itself to write-only code, they didn't consult with anyone > before implementing it, the standards group (including Microsoft) came > up with something better.> > -- > David Dorward> http://dorward.me.uk/> http://blog.dorward.me.uk/> > > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at dorward.me.uk Thu Apr 17 01:09:23 2008 From: david at dorward.me.uk (David Dorward) Date: Thu, 17 Apr 2008 07:09:23 +0100 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> Message-ID: <3F82C096-6035-4890-9392-508707E0E270@dorward.me.uk> On 17 Apr 2008, at 01:28, Troy III Ajnej wrote: > Yes, > but how do you hadle it, -how do you capture the bolean response > of true or false in case it fails to run var capturedReturnValue = myFunction(); > , or in casse it succeeded, how > do you check it prior to invoking other instuctions? if (capturedReturnValue) { } -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From david at dorward.me.uk Thu Apr 17 01:20:55 2008 From: david at dorward.me.uk (David Dorward) Date: Thu, 17 Apr 2008 07:20:55 +0100 Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkbox In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> Message-ID: <3A03F77B-73A7-4C3B-A490-54BE603BC0E3@dorward.me.uk> On 17 Apr 2008, at 03:07, Troy III Ajnej wrote: > I still don't see "MyElement" shorthand anywhere > (1997-2008 == more than a decade). There is a VERY significant difference between "A decade old" which the above statement uses and "A decade older then document.getElementById", which your email of 16 April 2008 06:02:07 BST uses. > > Generating global variables, which might conflict with built ins, > > simply by associating an HTML document with a JavaScript program > is a > > good way to generate confusing bugs during development and make > > maintenance a pain. > > I don't see how could a refference to the doc element have to do > anything with > associating HTML with Javascript or messing anything else up!
> > DOM 1 reached recommendation status in 1998 > > Sorry but I don't recall if it's first recommendation included the > "document.getElemen..." > statement in its apearence. If you don't recall, then why not look? http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-36113835 > It was DOM Level 2 that invented e different statement for > the same purpose and reached recommendation status only a month > before 2001. Incorrect, see above. > Eventhough FX didn't hesitate to implement it, but did it maliciously. Firefox implemented the standard ... maliciously. That makes no sense whatsoever. > Same goes with the famous .innerHTML. Firefox implemented innerHTML because lots of websites used it (because Microsoft implemented instead of promoting the standard, and IE was commonly used). I don't see any maliciousness there either. I don't see Firefox's implementation breaking when you edit the inside of tables either. > > It lent itself to write-only code, they didn't consult with anyone > > before implementing it, the standards group (including Microsoft) > came > > up with something better. > > :) Like What? document.getElementById > And what do you understand with "write-only"? That when someone comes along to read the code, it is not obvious where the variable is being declared (since it is generated by being associated with an HTML document, not from within the script itself). This results in code which is hard to edit. > What do you mean with "they didn't consult with anyone"? That they implemented it rather then proposing it to the standards group that they are, and were, a member of. > Do you understand that this acusation is a direct answer to the > question: -Who was, and still is hollding up the web??? I don't really care what it is in answer to. It is packed full of factual errors. > Don't forget that it was only in December 1997 that HTML 4.0 added > support for tables. > Can you imagine? -Tables! Right. Yes. HTML 4.0. Of course. http://www.w3.org/TR/REC-html32#table The whole situation with HTML at the time was a mess. It didn't help that browser vendors ran around implementing , and instead of trying to develop something good. So HTML 3 was scrapped and HTML 3.2 came along to document what they had some up with. > W3C recommended "document.getElement" a month before 2001, while > IE4-was allready three years old and running. Incorrect, see above. > So it was, still is, and allways will be, W3C. That statement is based on a number of false premises. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From david at dorward.me.uk Thu Apr 17 01:22:54 2008 From: david at dorward.me.uk (David Dorward) Date: Thu, 17 Apr 2008 07:22:54 +0100 Subject: [Javascript] IE onclick problem In-Reply-To: <4806AE6A.6010506@denhaag.org> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <4806AA1B.8020502@internetique.com> <4806AE6A.6010506@denhaag.org> Message-ID: > So I would argue that 'onsubmit="return checkMyForm()"' should read > 'onsubmit="checkMyForm()"' It shouldn't. > since the handler function itself returns a > true or false value to the onsubmit event It doesn't. If you don't use a return statement, nothing is returned. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From schneegans at internetique.com Thu Apr 17 07:52:00 2008 From: schneegans at internetique.com (Claude Schneegans) Date: Thu, 17 Apr 2008 08:52:00 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <4806AE6A.6010506@denhaag.org> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <4806AA1B.8020502@internetique.com> <4806AE6A.6010506@denhaag.org> Message-ID: <480747F0.6050908@internetique.com> >>since the handler function itself returns a true or false value to the onsubmit event, thereby cancelling or granting the submit event. You're right, there was some confusion on my side. From tedd at sperling.com Thu Apr 17 07:54:04 2008 From: tedd at sperling.com (tedd) Date: Thu, 17 Apr 2008 08:54:04 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <4806AE6A.6010506@denhaag.org> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <4806AA1B.8020502@internetique.com> <4806AE6A.6010506@denhaag.org> Message-ID: At 3:56 AM +0200 4/17/08, J. Lester Novros II wrote: >So I would argue that 'onsubmit="return checkMyForm()"' should read >'onsubmit="checkMyForm()"' since the handler function itself returns a >true or false value to the onsubmit event, thereby cancelling or granting >the submit event. Well -- it doesn't work that way for me. Here's a form where I use it: http://webbytedd.com/c/form-submit/ 'onsubmit=return checkMyForm()" <-- works where 'onsubmit=checkMyForm()" <-- doesn't Or is there something here I'm not understanding? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From java.script at cutterscrossing.com Thu Apr 17 08:06:21 2008 From: java.script at cutterscrossing.com (Cutter (JSRelated)) Date: Thu, 17 Apr 2008 08:06:21 -0500 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <4806AA1B.8020502@internetique.com> <4806AE6A.6010506@denhaag.org> Message-ID: <48074B4D.8070406@cutterscrossing.com> There must be something you're misunderstanding. I have hundreds of forms out there with onsubmit="validate()" (before I knew better). The validate function returns true or false, which either cancels the event or allows it depending on that return. Create a quick test case: function checkMyForm(){ return false; // Manually toggle this for your test } Then make a quick test form with onsubmit="checkMyForm()" to see what happens. Don't even worry about logic or other functionality right now, just the quick test case... Steve "Cutter" Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _____________________________ http://blog.cutterscrossing.com tedd wrote: > At 3:56 AM +0200 4/17/08, J. Lester Novros II wrote: >> So I would argue that 'onsubmit="return checkMyForm()"' should read >> 'onsubmit="checkMyForm()"' since the handler function itself returns a >> true or false value to the onsubmit event, thereby cancelling or granting >> the submit event. > > > Well -- it doesn't work that way for me. > > Here's a form where I use it: > > http://webbytedd.com/c/form-submit/ > > 'onsubmit=return checkMyForm()" <-- works > > where > > 'onsubmit=checkMyForm()" <-- doesn't > > Or is there something here I'm not understanding? > > Cheers, > > tedd > From tedd at sperling.com Thu Apr 17 09:14:41 2008 From: tedd at sperling.com (tedd) Date: Thu, 17 Apr 2008 10:14:41 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <48074B4D.8070406@cutterscrossing.com> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <4806AA1B.8020502@internetique.com> <4806AE6A.6010506@denhaag.org> <48074B4D.8070406@cutterscrossing.com> Message-ID: At 8:06 AM -0500 4/17/08, Cutter (JSRelated) wrote: >There must be something you're misunderstanding. I have hundreds of >forms out there with onsubmit="validate()" (before I knew better). The >validate function returns true or false, which either cancels the event >or allows it depending on that return. > >Create a quick test case: > >function checkMyForm(){ > return false; // Manually toggle this for your test >} > >Then make a quick test form with onsubmit="checkMyForm()" to see what >happens. Don't even worry about logic or other functionality right now, >just the quick test case... Steve: A simple one entry won't demonstrate the problem. Please follow: http://webbytedd.com/ccc/test-onsubmit/index.php Form One uses the onsubmit="return checkForm(this);" where as Form Two uses onsubmit="checkForm(this);" Now, without entering anything click the top Submit button. An alert will ask you to enter something in Anything 1. Enter something and click Submit again. An alert will ask you to enter something in Anything 2. Enter something and click Submit again. At this time the form will process. Now, without entering anything click the bottom Submit button. An alert will ask you to enter something in Anything 1. Enter something and click Submit again. An alert will ask you to enter something in Anything 1. BUT, please note that the form processed before having both fields populated -- not desired. As you can see, the performance of these two are not the same. Now, what am I misunderstanding? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hassan at webtuitive.com Thu Apr 17 09:42:04 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Thu, 17 Apr 2008 07:42:04 -0700 Subject: [Javascript] IE onclick problem In-Reply-To: <48074B4D.8070406@cutterscrossing.com> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <4806AA1B.8020502@internetique.com> <4806AE6A.6010506@denhaag.org> <48074B4D.8070406@cutterscrossing.com> Message-ID: <480761BC.7030005@webtuitive.com> Cutter (JSRelated) wrote: > validate function returns true or false, which either cancels the event > or allows it depending on that return. That's simply wrong. > Create a quick test case: > > function checkMyForm(){ > return false; // Manually toggle this for your test > } > > Then make a quick test form with onsubmit="checkMyForm()" to see what > happens. Yep, easy test case, which demonstrates that the above submits no matter what happens in the function, while onsubmit="return checkMyForm()" does not (when the returned value is false). It is certainly possible to have the function "trap" the event (i.e. cancel bubbling) but your example doesn't do that. -- Hassan Schroeder ----------------------------- hassan at webtuitive.com Webtuitive Design === (+1) 408-621-3445 === http://webtuitive.com dream. code. From hjess at cardomain.com Thu Apr 17 10:40:47 2008 From: hjess at cardomain.com (Howard Jess) Date: Thu, 17 Apr 2008 08:40:47 -0700 Subject: [Javascript] IE onclick problem In-Reply-To: References: Message-ID: <48076F7F.9090100@cardomain.com> > > tedd wrote: >> At 3:56 AM +0200 4/17/08, J. Lester Novros II wrote: >>> So I would argue that 'onsubmit="return checkMyForm()"' should read >>> 'onsubmit="checkMyForm()"' since the handler function itself returns a >>> true or false value to the onsubmit event, thereby cancelling or >>> granting >>> the submit event. >> >> >> Well -- it doesn't work that way for me. >> >> Here's a form where I use it: >> >> http://webbytedd.com/c/form-submit/ >> >> 'onsubmit=return checkMyForm()" <-- works >> >> where >> >> 'onsubmit=checkMyForm()" <-- doesn't >> >> Or is there something here I'm not understanding? >> >> Cheers, >> >> tedd >> > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Javascript mailing list > Javascript at lists.evolt.org > http://lists.evolt.org/mailman/listinfo/javascript The "onsubmit" property of the form element is defined as a function; therefore, when you assign it a string value in markup (as you must, since HTML attributes can only be strings, in markup), the string is converted to a function:
becomes (in pseudo-javascript) form.onsubmit = function() {checkMyForm()} whose value is undefined. It's much more clear to write: , which becomes form.onsubmit = function() {return checkMyForm()} And finally, it's *far* better to leave this attribute out of markup altogether, and do everything in javascript: ....
-- hj From fastpaced at yahoo.com Fri Apr 18 11:29:03 2008 From: fastpaced at yahoo.com (Sid D.) Date: Fri, 18 Apr 2008 09:29:03 -0700 (PDT) Subject: [Javascript] free project tracking system Message-ID: <465748.42255.qm@web45706.mail.sp1.yahoo.com> Hello All, We have a web based project tracking system, single project owners can sign up for free. Get your free online installation at http://www.project-tracking-system. You can further create resource logins and client login within the system. Demo details are available at http://www.project-tracking-system/demo.asp best, Sidharth. p.s. please forward this to your friends who can benefit from this. ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Fri Apr 18 11:53:27 2008 From: tedd at sperling.com (tedd) Date: Fri, 18 Apr 2008 12:53:27 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <48076F7F.9090100@cardomain.com> References: <48076F7F.9090100@cardomain.com> Message-ID: At 8:40 AM -0700 4/17/08, Howard Jess wrote: >And finally, it's *far* better to leave this attribute out of >markup altogether, and do everything in javascript: > >
....
> > > >-- >hj Yes, that is much better. Thanks, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Fri Apr 18 12:48:47 2008 From: tedd at sperling.com (tedd) Date: Fri, 18 Apr 2008 13:48:47 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <48076F7F.9090100@cardomain.com> References: <48076F7F.9090100@cardomain.com> Message-ID: At 8:40 AM -0700 4/17/08, Howard Jess wrote: >And finally, it's *far* better to leave this attribute out of >markup altogether, and do everything in javascript: > >
....
> > Howard: I spoke too soon -- take a look at this: http://webbytedd.com/ccc/test-onsubmit1/index.php Please note that while not entering the data required in each text box will generate an alert, it will not stop the submit. I provided a demo here: http://webbytedd.com/ccc/test-onsubmit/index.php The proper operation is to prohibit a submit until both text boxes have data. So, how do you do that while remaining unobtrusive? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From david at dorward.me.uk Fri Apr 18 13:50:26 2008 From: david at dorward.me.uk (David Dorward) Date: Fri, 18 Apr 2008 19:50:26 +0100 Subject: [Javascript] IE onclick problem In-Reply-To: References: <48076F7F.9090100@cardomain.com> Message-ID: <6CD5B8B3-5B5B-447B-A52D-1EA9BAC95E7A@dorward.me.uk> On 18 Apr 2008, at 18:48, tedd wrote: >> > > Howard: > > I spoke too soon -- take a look at this: > > http://webbytedd.com/ccc/test-onsubmit1/index.php You have: form.onsubmit = checkForm(form); So you are calling checkForm, with the the form as an argument, and assigning the return value to onsubmit. The return value is going to be false (since the form isn't filled in at load time), but it needs to be a function. form.onsubmit = function (f) { return function () { checkForm(f) }; }(form); Here I generate an anonymous function with one argument, and call it with the form as the argument immediately. The return value (another anonymous function, which calls checkForm when it is run) is assigned to onsubmit. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From hjess at cardomain.com Fri Apr 18 13:57:42 2008 From: hjess at cardomain.com (Howard Jess) Date: Fri, 18 Apr 2008 11:57:42 -0700 Subject: [Javascript] IE onclick problem In-Reply-To: References: <48076F7F.9090100@cardomain.com> Message-ID: <4808EF26.8090200@cardomain.com> tedd wrote: > At 8:40 AM -0700 4/17/08, Howard Jess wrote: >> And finally, it's *far* better to leave this attribute out of >> markup altogether, and do everything in javascript: >> >>
....
>> >> > > Howard: > > I spoke too soon -- take a look at this: > > http://webbytedd.com/ccc/test-onsubmit1/index.php > > Please note that while not entering the data required in each text box > will generate an alert, it will not stop the submit. > > I provided a demo here: > > http://webbytedd.com/ccc/test-onsubmit/index.php The onsubmit property is a function reference, as I suggested: form.onsubmit = checkMyForm; Your example, which doesn't work, says: window.onload=function() { var form=document.getElementById('a'); if (form) { form.onsubmit = checkForm(form); } } The line you specify invokes the checkForm function, rather than referring to it, and sets the onsubmit property to false; notice that you get the alert prompt on first display of the page, *before* you hit submit. Try: window.onload = function() { var form = document.getElementById('a'); form.onsubmit = function() {return checkForm(form)}; } or if you don't like that, try: window.onload = function() { var form = document.getElementById('a'); function submitter() { return checkForm(form); } form.onsubmit = submitter; } -- Howard Jess | CarDomain Network Software Engineer 1633 Westlake Avenue North, Suite 100, Seattle, WA 98109 hjess at cardomain.com | tel 206.926.2144 | fax 206.926.2299 http://members.cardomain.com/verklempt From tedd at sperling.com Fri Apr 18 17:36:18 2008 From: tedd at sperling.com (tedd) Date: Fri, 18 Apr 2008 18:36:18 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <4808EF26.8090200@cardomain.com> References: <48076F7F.9090100@cardomain.com> <4808EF26.8090200@cardomain.com> Message-ID: At 11:57 AM -0700 4/18/08, Howard Jess wrote: >tedd wrote: >> At 8:40 AM -0700 4/17/08, Howard Jess wrote: >>> And finally, it's *far* better to leave this attribute out of >>> markup altogether, and do everything in javascript: >>> >>>
....
>>> >>> >> >> Howard: >> >> I spoke too soon -- take a look at this: >> > > http://webbytedd.com/ccc/test-onsubmit1/index.php >> >> Please note that while not entering the data required in each text box >> will generate an alert, it will not stop the submit. >> >> I provided a demo here: >> > > http://webbytedd.com/ccc/test-onsubmit/index.php > >The onsubmit property is a function reference, as I suggested: > > form.onsubmit = checkMyForm; > >Your example, which doesn't work, says: > >window.onload=function() { > var form=document.getElementById('a'); > if (form) { > form.onsubmit = checkForm(form); > } >} > >The line you specify invokes the checkForm function, rather than >referring to it, and sets the onsubmit property to false; notice >that you get the alert prompt on first display of the page, *before* >you hit submit. > >Try: > window.onload = function() { > var form = document.getElementById('a'); > form.onsubmit = function() {return checkForm(form)}; > } > >or if you don't like that, try: > window.onload = function() { > var form = document.getElementById('a'); > function submitter() { > return checkForm(form); > } > form.onsubmit = submitter; > } > Okay, I understand both of those. Those are more in keeping with the original post question, which discussed the difference between "return checkForm(this)" and "checkForm(this)" -- the later not working. Thanks, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From tedd at sperling.com Fri Apr 18 18:41:36 2008 From: tedd at sperling.com (tedd) Date: Fri, 18 Apr 2008 19:41:36 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <6CD5B8B3-5B5B-447B-A52D-1EA9BAC95E7A@dorward.me.uk> References: <48076F7F.9090100@cardomain.com> <6CD5B8B3-5B5B-447B-A52D-1EA9BAC95E7A@dorward.me.uk> Message-ID: At 7:50 PM +0100 4/18/08, David Dorward wrote: >On 18 Apr 2008, at 18:48, tedd wrote: >>> >> >> Howard: >> >> I spoke too soon -- take a look at this: >> >> http://webbytedd.com/ccc/test-onsubmit1/index.php > > >You have: > form.onsubmit = checkForm(form); > >So you are calling checkForm, with the the form as an argument, and >assigning the return value to onsubmit. > >The return value is going to be false (since the form isn't filled in >at load time), but it needs to be a function. > > form.onsubmit = function (f) { > return function () { > checkForm(f) > }; > }(form); > >Here I generate an anonymous function with one argument, and call it >with the form as the argument immediately. The return value (another >anonymous function, which calls checkForm when it is run) is assigned >to onsubmit. That still did not seem to work as it should -- unless I screwed up (most likely). But, the code provided by Howard did work. Thanks all. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From trojani2000 at hotmail.com Fri Apr 18 22:35:06 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sat, 19 Apr 2008 03:35:06 +0000 Subject: [Javascript] IE onclick problem In-Reply-To: <3F82C096-6035-4890-9392-508707E0E270@dorward.me.uk> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <3F82C096-6035-4890-9392-508707E0E270@dorward.me.uk> Message-ID: Sorry, but > var capturedReturnValue = myFunction();just won't do! You are asigning the function to the var. It imediately calls the function execution and in casse it was referrenced from some other function as well, might end up in loop execution. I still don't see how to utilize such a claim nor make it work. At least not by asigning a function to the var, because: >if (capturedReturnValue) {... will allways act as TRUE since it's not an empty strig.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: david at dorward.me.uk> To: javascript at lists.evolt.org> Date: Thu, 17 Apr 2008 07:09:23 +0100> Subject: Re: [Javascript] IE onclick problem> > > On 17 Apr 2008, at 01:28, Troy III Ajnej wrote:> > Yes,> > but how do you hadle it, -how do you capture the bolean response> > of true or false in case it fails to run> > var capturedReturnValue = myFunction();> > > , or in casse it succeeded, how> > do you check it prior to invoking other instuctions?> > if (capturedReturnValue) {> > }> > -- > David Dorward> http://dorward.me.uk/> http://blog.dorward.me.uk/> > > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Get in touch in an instant. Get Windows Live Messenger now. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_getintouch_042008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at dorward.me.uk Sat Apr 19 02:31:38 2008 From: david at dorward.me.uk (David Dorward) Date: Sat, 19 Apr 2008 08:31:38 +0100 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <3F82C096-6035-4890-9392-508707E0E270@dorward.me.uk> Message-ID: <915F0F75-2EA4-434D-8F25-F59E150FA6B8@dorward.me.uk> On 19 Apr 2008, at 04:35, Troy III Ajnej wrote: > Sorry, but > > var capturedReturnValue = myFunction(); > just won't do! You are asigning the function to the var. No, it is the return value of the function. If that was assigning the function it would be: var anotherRefToTheFunction = myFunction; > It imediately calls the function execution and in casse it was > referrenced from some other function as well, might end up > in loop execution. So don't write the script to call it in a recursive fashion. > I still don't see how to utilize such a claim nor make it work. > At least not by asigning a function to the var, because: > >if (capturedReturnValue) {... > will allways act as TRUE since it's not an empty strig. The function can be written to return whatever you like, including on of the many things (not limited to empty strings) that are false values. -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From trojani2000 at hotmail.com Sat Apr 19 04:02:17 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sat, 19 Apr 2008 09:02:17 +0000 Subject: [Javascript] IE onclick problem In-Reply-To: <915F0F75-2EA4-434D-8F25-F59E150FA6B8@dorward.me.uk> References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <3F82C096-6035-4890-9392-508707E0E270@dorward.me.uk> <915F0F75-2EA4-434D-8F25-F59E150FA6B8@dorward.me.uk> Message-ID: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: david at dorward.me.uk> To: javascript at lists.evolt.org> Date: Sat, 19 Apr 2008 08:31:38 +0100> Subject: Re: [Javascript] IE onclick problem> > > On 19 Apr 2008, at 04:35, Troy III Ajnej wrote:> > Sorry, but> > > var capturedReturnValue = myFunction();> > just won't do! You are asigning the function to the var.> > No, it is the return value of the function. I think my english is not god enough..., you are assigning the function-name (that is: a function call) to the "var capturedReturnValue" So, if you write it as a global 'var', it will simply invoke that function during load time. In casse you declare it inside a function it will call the execution of it, same way. > If that was assigning the > function it would be:> > var anotherRefToTheFunction = myFunction; That, in contrast will assign the function-body to the var. > The function can be written to return whatever you like, including on > of the many things (not limited to empty strings) that are false values. All right, -how do you write it so it will return, !not execute myFunction(), but at least alert you from another function that: myFunction() did execute succesfully without executing it accidentally on-check time or before user-action? > David Dorward> http://dorward.me.uk/> http://blog.dorward.me.uk/> > > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript _________________________________________________________________ Going green? See the top 12 foods to eat organic. http://green.msn.com/galleries/photos/photos.aspx?gid=164&ocid=T003MSN51N1653A -------------- next part -------------- An HTML attachment was scrubbed... URL: From trojani2000 at hotmail.com Sat Apr 19 04:38:40 2008 From: trojani2000 at hotmail.com (Troy III Ajnej) Date: Sat, 19 Apr 2008 09:38:40 +0000 Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkbox In-Reply-To: <3A03F77B-73A7-4C3B-A490-54BE603BC0E3@dorward.me.uk> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> <3A03F77B-73A7-4C3B-A490-54BE603BC0E3@dorward.me.uk> Message-ID: > From: david at dorward.me.uk> To: javascript at lists.evolt.org> Date: Thu, 17 Apr 2008 07:20:55 +0100> Subject: Re: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkbox> > > There is a VERY significant difference between "A decade old" which > the above statement uses and "A decade older then > document.getElementById", which your email of 16 April 2008 06:02:07 > BST uses. True!But I think you somehow manage to miss my point. > > > Generating global variables, which might conflict with built ins, >
>
>
A set of "reserved words" will never sieze to exist. There will allways be a setof some reserved words, so this is simply an overreaction. If a coder was thateager to name a portion of his text with such a fullish name as "window" or "alert", simply by changing the "window" with "Window" or "alert" with "Alert"would be more than satisfying. -One of the reasons why js is casse sensitive. > > > DOM 1 reached recommendation status in 1998> >> > Sorry but I don't recall if it's first recommendation included the > > "document.getElemen..."> > statement in its apearence.> If you don't recall, then why not look?> http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-36113835 I was being educated.Because I already did a re-check while writting! Please view the: http://www.w3.org/TR/DOM-Level-2-Core/core.html > > It was DOM Level 2 that invented e different statement for> > the same purpose and reached recommendation status only a month > > before 2001.> > Incorrect, see above. Correct all the way! It was a re-invetnion of the wheel. It was "getElementsByTagName" that was proposed in Level 1 not the ID. To be more exact, this link (se below), will navigate you strait to the paragraph of our matter in discussion, http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBId same page as the above. Where it explicitely states: "getElementById introduced in DOM Level 2" This, -once again - proves that "document.getElementById" is Level 2, and was ~introduced~ only a month before 2001 respectively. > > Eventhough FX didn't hesitate to implement it, but did it maliciously.> Firefox implemented the standard ... maliciously. That makes no sense > whatsoever. The "it" language var cited above meant "reference by ID", I never said "FX implemented the standard", why do you alter my words? -So it does make sense! > > Same goes with the famous .innerHTML.> > Firefox implemented innerHTML because lots of websites used it > (because Microsoft implemented instead of promoting the standard, and > IE was commonly used). I don't see any maliciousness there either. I > don't see Firefox's implementation breaking when you edit the inside > of tables either. O really! Why did FX implement the NON-STANDARD innerHTML?Why did FX support the NON-STANDARD reference by ID? While providing error mesage:"Element rreferenced by Name/ID use standard getElementById() instead".I'ts obviously malicious! Today this message doesn't turn your Error Console button into red, but it used to.And what about innerHTML, it doesn't even yeld a soft error nor a warnig message! Does it mean that innerHTML has become a standard?!!FX never met a W3C standards and never will. It's a pure demagogy and you know that. > > > It lent itself to write-only code, they didn't consult with anyone> > > before implementing it, the standards group (including Microsoft) > > came> > > up with something better.> >> > :) Like What?> > document.getElementById Let's see... > > And what do you understand with "write-only"? > That when someone comes along to read the code, it is not obvious > where the variable is being declared (since it is generated by being > associated with an HTML document, not from within the script itself). > This results in code which is hard to edit. Nonsense...Complete nonsense. First of, -where do you look before assigning your vars? Or do you arbitrarily try toassing whatever comes to your mind, hopping that it will call the object you are aiming to, by guess or something? "MyElement" is not a variable, it's the actuall object you are referrening to, -and there will be no guess nor any place for confussion.That way you can never go wrong about. On contrast, what makes the element referrencing a real pain is a completely independent naming convention of vars that refer to them. MyElement.width="value" compared to: var anyName = document.getElementById("MyElement").width="value" is actually what makes it almost impossible to edit some one else's document. You'll have to digg in three different places to find out what is the correct id/name of the element referred from this var; where was it declared; find the original name/id of it; find it in HTML; check if there is everything right than go through CSS to find that there was some banal typing error causing your function to fail or to act as not expected. > > What do you mean with "they didn't consult with anyone"?> > That they implemented it rather then proposing it to the standards > group that they are, and were, a member of. I allready pointed out that IE4 was allready out and running for thee long coding years before they even came up with any proposal. Douring the time you are talking about, W3C was bussy cleaning the mess they've created with the GIF format and pattents and were intensely preocupied with PNG developement. They didn't even turn their eyes on the matters we are talking about. > > Do you understand that this acusation is a direct answer to the> > question: -Who was, and still is hollding up the web???> > I don't really care what it is in answer to. It is packed full of > factual errors.> As we can clearly see, the facts are all in the right place. > > Don't forget that it was only in December 1997 that HTML 4.0 added > > support for tables.> > Can you imagine? -Tables!> > Right. Yes. HTML 4.0. Of course. http://www.w3.org/TR/REC-html32#table> > The whole situation with HTML at the time was a mess. It didn't help > that browser vendors ran around implementing , and > instead of trying to develop something good. So HTML 3 was > scrapped and HTML 3.2 came along to document what they had some up with. So, as you see, they were not capable of even dealing with such a fundamental need like tablesat the time, but you expect them to address things like how to manipulate the DOM?! > > W3C recommended "document.getElement" a month before 2001, while> > IE4-was allready three years old and running.> > Incorrect, see above. Correct all the way, as you can see from above too. -They should have used the same policy as they did with other coding practices and embrace what was allready a standard in the coding "world". If itweren't for them taking sides... For more than three years, coders around the world got used to "MyElement" solution with no alternative recommendation. Accusing IE for being non-compliant is a pure demagogy. One can not write you a ticket for exceeding speed-limit yesterday while driving 70mph, simply because today the speed limit for that road is reduced to 60mph by God himself, shortly known as W3C & his felow cancelor FX. > > So it was, still is, and allways will be, W3C. Mean time, while W3C was holding back the web, coders turned to using Flash and other plugin alternativesfilling the vacuume they (W3C) almost puposedly created. In 2001 flash couldn't do anything more fancier than IE4.1 filters could do, -today html and scripting has become a simple tool for hidding url's of flash content from pages that every day more and more rely on third party plugins. There are 30% of pages completely built in flash. Other 40% are hybrids, and all because W3C is still holding back the web... I salute them. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _________________________________________________________________ Going green? See the top 12 foods to eat organic. http://green.msn.com/galleries/photos/photos.aspx?gid=164&ocid=T003MSN51N1653A -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at dorward.me.uk Sat Apr 19 07:04:59 2008 From: david at dorward.me.uk (David Dorward) Date: Sat, 19 Apr 2008 13:04:59 +0100 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <3F82C096-6035-4890-9392-508707E0E270@dorward.me.uk> <915F0F75-2EA4-434D-8F25-F59E150FA6B8@dorward.me.uk> Message-ID: <62443594-5903-481E-831E-6C24B7F3B38F@dorward.me.uk> On 19 Apr 2008, at 10:02, Troy III Ajnej wrote: > > On 19 Apr 2008, at 04:35, Troy III Ajnej wrote: > > > Sorry, but > > > > var capturedReturnValue = myFunction(); > > > just won't do! You are asigning the function to the var. > > > No, it is the return value of the function. > > I think my english is not god enough..., > you are assigning the function-name (that is: a function call) to > the "var capturedReturnValue" No. var capturedReturnValue = myFunction(); That executes the function and assigns whatever value it returns to capturedReturnValue. var referenceToFunction = myFunction; Without the () to *call* the function it will assign the function to the variable. If you couldn't call functions, JavaScript wouldn't be a usable language. > All right, -how do you write it so it will return, !not execute > myFunction(), > but at least alert you from another function that: myFunction() did > execute > succesfully without executing it accidentally on-check time or > before user-action? If you want to return a function then: function myFunction() { return function () { var something = doSomething(); doSomethingElse(; return something; } } -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From david at dorward.me.uk Sat Apr 19 07:07:00 2008 From: david at dorward.me.uk (David Dorward) Date: Sat, 19 Apr 2008 13:07:00 +0100 Subject: [Javascript] IE onclick problem In-Reply-To: References: <480553F7.4090108@bigskypenguin.com> <480590F8.4070109@internetique.com> <2D037D51-90E1-49A8-BE35-A74E282A391A@dorward.me.uk> <3F82C096-6035-4890-9392-508707E0E270@dorward.me.uk> <915F0F75-2EA4-434D-8F25-F59E150FA6B8@dorward.me.uk> Message-ID: <25782E6B-7186-4780-9AB8-E521FD9B1384@dorward.me.uk> On 19 Apr 2008, at 10:02, Troy III Ajnej wrote: > > On 19 Apr 2008, at 04:35, Troy III Ajnej wrote: > > > Sorry, but > > > > var capturedReturnValue = myFunction(); > > > just won't do! You are asigning the function to the var. > > > No, it is the return value of the function. > > I think my english is not god enough..., > you are assigning the function-name (that is: a function call) to > the "var capturedReturnValue" No. var capturedReturnValue = myFunction(); That executes the function and assigns whatever value it returns to capturedReturnValue. var referenceToFunction = myFunction; Without the () to *call* the function it will assign the function to the variable. If you couldn't call functions, JavaScript wouldn't be a usable language. > All right, -how do you write it so it will return, !not execute > myFunction(), > but at least alert you from another function that: myFunction() did > execute > succesfully without executing it accidentally on-check time or > before user-action? If you want to return a function then: function myFunction() { return function () { var something = doSomething(); doSomethingElse(; return something; } } -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From david at dorward.me.uk Sat Apr 19 07:29:04 2008 From: david at dorward.me.uk (David Dorward) Date: Sat, 19 Apr 2008 13:29:04 +0100 Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkbox In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <47FFDBBC.5040505@internetique.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> <3A03F77B-73A7-4C3B-A490-54BE603BC0E3@dorward.me.uk> Message-ID: <83FCBFD4-7109-42FE-9D16-2E9021F6BD5F@dorward.me.uk> On 19 Apr 2008, at 10:38, Troy III Ajnej wrote: > > > > Generating global variables, which might conflict with built > ins, > >
> >
> >
> > A set of "reserved words" will never sieze to exist. Yes, but having reserved words in JavaScript should not influence any decision made about the HTML. > > http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-36113835 > > I was being educated. > Because I already did a re-check while writting! > Please view the: http://www.w3.org/TR/DOM-Level-2-Core/core.html Existing in DOM level 2 doesn't stop it existing in DOM level 1 as well. > Correct all the way! It was a re-invetnion of the wheel. It was > "getElementsByTagName" > that was proposed in Level 1 not the ID. See the link I provided previously. > http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBId > > same page as the above. Where it explicitely states: "getElementById > introduced in DOM Level 2" > This, -once again - proves that "document.getElementById" is Level > 2, and was ~introduced~ only a > month before 2001 respectively. It was made more flexible and introduced into DOM Core Level 2. It already existed in an HTML specific form in DOM HTML Level 1 (I assume that this is because they needed to have some way to define "id" in a generic way for XML: http://www.w3.org/TR/xml-id/ ). See the link I provided before: http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-36113835 . Note the date in it. The W3C do NOT edit old specifications, release them under exactly the same name (they add revision information to the title) and then publish at the same citable (as opposed to "quick link to the latest version") URI. > > > Eventhough FX didn't hesitate to implement it, but did it > maliciously. > > > Firefox implemented the standard ... maliciously. That makes no > sense > > whatsoever. > > The "it" language var cited above meant "reference by ID", I never > said "FX implemented the standard", > why do you alter my words? -So it does make sense! I must have misinterpreted you. How did they implement support for Microsoft's proprietary system _ maliciously_? > > > > Same goes with the famous .innerHTML. > > > > Firefox implemented innerHTML because lots of websites used it > > (because Microsoft implemented instead of promoting the standard, > and > > IE was commonly used). I don't see any maliciousness there either. I > > don't see Firefox's implementation breaking when you edit the inside > > of tables either. > > O really! > Why did FX implement the NON-STANDARD innerHTML? Because Microsoft had massive market share and influence, so many developers who didn't know better used the proprietary system ... and they didn't want to produce a browser that lots of sites simply didn't work with. > Why did FX support the NON-STANDARD reference by ID? While providing > error mesage: > "Element rreferenced by Name/ID use standard getElementById() > instead". It's a warning. There is a standard, which Microsoft was partly responsible for, and a (poor) proprietary system. Warning for use of non-standard constructs is a perfectly standard part of compiler / interpreter design. > I'ts obviously malicious! Promoting a (better) standard over a proprietary system is not malicious. > Today this message doesn't turn your Error Console button into red, > but it used to. > And what about innerHTML, it doesn't even yeld a soft error nor a > warnig message! > Does it mean that innerHTML has become a standard?!! It is being worked on. http://www.w3.org/html/wg/html5/#innerhtml0 > FX never met a W3C standards and never will. It's a pure demagogy > and you know that. Garbage. > > > > It lent itself to write-only code, they didn't consult with > anyone > > > > before implementing it, the standards group (including > Microsoft) > > > came > > > > up with something better. > > > > > > :) Like What? > > > > document.getElementById > > Let's see... > > > > And what do you understand with "write-only"? > > That when someone comes along to read the code, it is not obvious > > where the variable is being declared (since it is generated by being > > associated with an HTML document, not from within the script > itself). > > This results in code which is hard to edit. > > Nonsense... > Complete nonsense. > First of, -where do you look before assigning your vars? Or do you > arbitrarily try to > assing whatever comes to your mind, hopping that it will call the > object you are aiming to, > by guess or something? What does that have to do with reading other people's code? > "MyElement" is not a variable, it's the actuall object you are > referrening to No, it is an variable containing an object reference. > , -and there > will be no guess nor any place for confussion.That way you can never > go wrong about. > On contrast, what makes the element referrencing a real pain is a > completely independent > naming convention of vars that refer to them. There is nothing stopping you assigning the return value of getElementById to a variable with the same or a similar name as the id of the element. > > MyElement.width="value" compared to: > var anyName = document.getElementById("MyElement").width="value" > is actually what makes it almost impossible to edit some one else's > document. Well yes. If you will compare proprietary code to a syntax error, then obviously the former will win. > You'll have to > digg in three different places to find out what is the correct id/ > name of the element referred from > this var; where was it declared; find the original name/id of it; > find it in HTML; check if > there is everything right than go through CSS to find that there was > some banal typing error > causing your function to fail or to act as not expected. Generally speaking, people declare their variables at the top of the function that uses them, it isn't far to look. Then you give them a similar name, and what's the problem? > > > What do you mean with "they didn't consult with anyone"? > > > > That they implemented it rather then proposing it to the standards > > group that they are, and were, a member of. > > I allready pointed out that IE4 was allready out and running for > thee long coding years before > they even came up with any proposal. As pointed out above, you are wrong about that. > Douring the time you are talking about, W3C was bussy cleaning the > mess they've created with the > GIF format and pattents and were intensely preocupied with PNG > developement. They didn't even turn > their eyes on the matters we are talking about. > > > > Do you understand that this acusation is a direct answer to the > > > question: -Who was, and still is hollding up the web??? > > > > I don't really care what it is in answer to. It is packed full of > > factual errors. > > > As we can clearly see, the facts are all in the right place. No, you are still misinterpreting what you are reading. > > > > Don't forget that it was only in December 1997 that HTML 4.0 added > > > support for tables. > > > Can you imagine? -Tables! > > > > Right. Yes. HTML 4.0. Of course. http://www.w3.org/TR/REC-html32#table > > > > The whole situation with HTML at the time was a mess. It didn't help > > that browser vendors ran around implementing , and > > instead of trying to develop something good. So HTML 3 was > > scrapped and HTML 3.2 came along to document what they had some up > with. > > So, as you see, they were not capable of even dealing with such a > fundamental need like tables > at the time, but you expect them to address things like how to > manipulate the DOM?! *headdesk* The HTML 3 drafts had tables in them too: http://www.w3.org/MarkUp/html3/tables.html Their problem was browser vendors implementing proprietary stuff and ignoring standards, you can't blame them for that. How is the W3C supposed to be "holding back the web" if browser vendors are ignoring them? > > > W3C recommended "document.getElement" a month before 2001, while > > > IE4-was allready three years old and running. > > > > Incorrect, see above. > > Correct all the way, as you can see from above too. No, I've pointed you at a 1998 document that defined document.getElementById as it relates to HTML documents. > For more than three years, coders around the world got used to > "MyElement" solution with no alternative > recommendation. Accusing IE for being non-compliant is a pure > demagogy. Incorrect, see 1998 document. > One can not write you a ticket for exceeding speed-limit yesterday > while driving 70mph, simply because > today the speed limit for that road is reduced to 60mph by God > himself, shortly known as W3C & his felow > cancelor FX. Firefox didn't even exist when that specification came out. I suspect Microsoft had more influence over it then any entity that had anything to do with what would become the Firefox codebase. > > > > So it was, still is, and allways will be, W3C. > > Mean time, while W3C was holding back the web, coders turned to > using Flash and other plugin alternatives > filling the vacuume they (W3C) almost puposedly created. I've lost track. Is this the period after Microsoft crushed Netscape, and then dominated the browser market with IE6 which went though half a decade without any development? -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ From tedd at sperling.com Sat Apr 19 11:14:57 2008 From: tedd at sperling.com (tedd) Date: Sat, 19 Apr 2008 12:14:57 -0400 Subject: [Javascript] IE onclick problem Message-ID: At 11:57 AM -0700 4/18/08, Howard Jess wrote: The line you specify invokes the checkForm function, rather than >referring to it, and sets the onsubmit property to false; notice >that you get the alert prompt on first display of the page, *before* >you hit submit. > >Try: > window.onload = function() { > var form = document.getElementById('a'); > form.onsubmit = function() {return checkForm(form)}; > } > >or if you don't like that, try: > window.onload = function() { > var form = document.getElementById('a'); > function submitter() { > return checkForm(form); > } > form.onsubmit = submitter; > } > Another question -- what if you have two forms? window.onload=function() { var form=document.getElementById('a'); function submitter() { return checkForm(form) } form.onsubmit = submitter; var form=document.getElementById('b'); function submitter() { return checkForm(form) } form.onsubmit = submitter; } Doesn't work for two forms. How can you have an unobtrusive onsubmit function tied to an unique id form on a document that contains several forms -- such that IF its submit button is clicked, then that form is processed (i.e., evaluated for content) while not processing the other forms? Now, I can do this with an in-line: onsubmit="return checkForm(this);" for each form, but how do you do that and be unobtrusive? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com _______________________________________________ Javascript mailing list Javascript at lists.evolt.org http://lists.evolt.org/mailman/listinfo/javascript -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From liorean at gmail.com Sat Apr 19 12:26:48 2008 From: liorean at gmail.com (liorean) Date: Sat, 19 Apr 2008 19:26:48 +0200 Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkbox In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <4800C5AD.5060204@webtuitive.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> <3A03F77B-73A7-4C3B-A490-54BE603BC0E3@dorward.me.uk> Message-ID: > > From: david at dorward.me.uk > > > > DOM 1 reached recommendation status in 1998 > > > > > > Sorry but I don't recall if it's first recommendation included the > > > "document.getElemen..." > > > statement in its apearence. > > If you don't recall, then why not look? On 19/04/2008, Troy III Ajnej wrote: > http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-36113835 > > I was being educated. > Because I already did a re-check while writting! > Please view the: > http://www.w3.org/TR/DOM-Level-2-Core/core.html > > > It was DOM Level 2 that invented e different statement for > > > the same purpose and reached recommendation status only a month > > > before 2001. > > > > Incorrect, see above. > > Correct all the way! It was a re-invetnion of the wheel. It was > "getElementsByTagName" > that was proposed in Level 1 not the ID. To be more exact, this link (se > below), will > navigate you strait to the paragraph of our matter in discussion, > > http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBId > > same page as the above. Where it explicitely states: "getElementById > introduced in DOM Level 2" > This, -once again - proves that "document.getElementById" is Level 2, and > was ~introduced~ only a > month before 2001 respectively. DOM1Core introduced getElementsByTagName on Document. DOM1HTML introduced getElementById, getElementsByName on HTMLDocument. DOM2Core introduced getElementById on Document. Thus, DOM2Core didn't introduce document.getElementById because in browsers, document was an HTMLDocument, which means they had the DOM1HTML interfaces to go by. > > > Eventhough FX didn't hesitate to implement it, but did it maliciously. > > > Firefox implemented the standard ... maliciously. That makes no sense > > whatsoever. > > The "it" language var cited above meant "reference by ID", I never said "FX > implemented the standard", > why do you alter my words? -So it does make sense! No it's still total gibberish. > > > Same goes with the famous .innerHTML. > > > > Firefox implemented innerHTML because lots of websites used it > > (because Microsoft implemented instead of promoting the standard, and > > IE was commonly used). I don't see any maliciousness there either. I > > don't see Firefox's implementation breaking when you edit the inside > > of tables either. > > O really! > Why did FX implement the NON-STANDARD innerHTML? Because live web content wanted to use the feature, and the W3C DOM had not standardised anything even close to as practical for programmers. > Why did FX support the NON-STANDARD reference by ID? While providing error > mesage: > "Element rreferenced by Name/ID use standard getElementById() instead". > I'ts obviously malicious! Firefox didn't even exist at the time getElementById was standardised. Meanwhile, using ids as variable names were never standard and is a problem that has plagued us for a long time. > Today this message doesn't turn your Error Console button into red, but it > used to. > And what about innerHTML, it doesn't even yeld a soft error nor a warnig > message! > Does it mean that innerHTML has become a standard?!! A de facto standard, even if not a de jure standard. (Yet!) Why try to demonise introduction of features that no standard covers? If there is something you want to be able to do, but there is no standard for it yet, do you think it's reasonable to submit the idea to a standards committee, have it draft and get consensus for the feature, and take it to CR before you try to implement? Heck no! You make a prototype implementation to build a spec proposal from, then you submit that spec, and keep yourself open to changing the interface as the standardisation process goes on. Introducing a feature is only malicious if: - It directly competes with a current standard achieving the same thing. - It breaks significant amounts of live content. (Significant can be as low as fractions of a per cent here, because the web is so massive.) - You don't spec it out publicly, so authors don't know exactly how it works. - You don't make it behave in the most natural way for most given usages. - You don't submit it to a standards body but instead force your competitors to reverse engineer your implementation. - You continually change the way it's implemented. > FX never met a W3C standards and never will. It's a pure demagogy and you > know that. NOBODY has proven full conformance to ANY web standard. Mozilla has a considerable adoption of a considerable amount of web standards, however. Much larger than Microsoft has. As it stands, Mozilla is fairly standards compliant. Various standards are supported to various degrees, and there's bugs in the implementations, sure. To say that it's pure demagogy is patently false though - there is a public bug database which proves Mozilla has a considerable effort poured into meeting the W3C standards. > > > > It lent itself to write-only code, they didn't consult with anyone > > > > before implementing it, the standards group (including Microsoft) > > > came > > > > up with something better. > > > > > > :) Like What? > > > > document.getElementById > > Let's see... > > > > And what do you understand with "write-only"? > > That when someone comes along to read the code, it is not obvious > > where the variable is being declared (since it is generated by being > > associated with an HTML document, not from within the script itself). > > This results in code which is hard to edit. > > Nonsense... > Complete nonsense. > First of, -where do you look before assigning your vars? Or do you > arbitrarily try to > assing whatever comes to your mind, hopping that it will call the object you > are aiming to, > by guess or something? You of course look in all the scripts you have, as well as what objects are implemented on the Window object of each browser. However, having the set of properties that are defined on window change because you use some names or ids on elements within the document, now that lends to write-only code. If the script cannot be authored without explicit knowledge of the document that it's linked or embedded in, then that's bad design of the system. Another example of this is the if-variable-is-not-found-default-to-creating-a-new-global-variable behaviour of JavaScript. > "MyElement" is not a variable, it's the actuall object you are referrening > to, -and there > will be no guess nor any place for confussion.That way you can never go > wrong about. > On contrast, what makes the element referrencing a real pain is a > completely independent > naming convention of vars that refer to them. Elements shouldn't be global variables in the first place. Sure, there are better designs than the one the DOM uses which could have been adopted, but having every named element as a global when the script writer doesn't necessarily know anything about the document is madness. > MyElement.width="value" compared to: > var anyName = > document.getElementById("MyElement").width="value" > is actually what makes it almost impossible to edit some one else's > document. You'll have to > digg in three different places to find out what is the correct id/name of > the element referred from > this var; where was it declared; find the original name/id of it; find it in > HTML; check if > there is everything right than go through CSS to find that there was some > banal typing error > causing your function to fail or to act as not expected. The script source shouldn't depend on the document, and the other way around. That's bad separation of concerns. Hardcoding names of elements is bad software engineering. > > > What do you mean with "they didn't consult with anyone"? > > > > That they implemented it rather then proposing it to the standards > > group that they are, and were, a member of. > > I allready pointed out that IE4 was allready out and running for thee long > coding years before > they even came up with any proposal. Wrong. The first DOM proposal reached FPWD only a month after IE4 was first released - Microsoftian Scott Isaacs was an editor for the early drafts, later replaced by the current Platform Architect for Internet Explorer and HTML WG co-chair Chris Wilson. Granted, it took until 1998-07-20 for the getElementsById method to appear, but Microsoft never proposed document.all or this global variable binding in that WG, from what I could see. > Douring the time you are talking about, W3C was bussy cleaning the mess > they've created with the > GIF format and pattents and were intensely preocupied with PNG developement. > They didn't even turn > their eyes on the matters we are talking about. Are you aware that you're talking about the period when Netscape, Microsoft and loads of other interests were spewing out more proposals than they ever have? Most were rejected of course, but this period was when things really happened in the W3C: HTML/XHTML, CSS and DOM were actively developed and everybody was involved in everything. > > > Do you understand that this acusation is a direct answer to the > > > question: -Who was, and still is hollding up the web??? > > > > I don't really care what it is in answer to. It is packed full of > > factual errors. > > > As we can clearly see, the facts are all in the right place. Yes, but they don't support your argument. > > > Don't forget that it was only in December 1997 that HTML 4.0 added > > > support for tables. > > > Can you imagine? -Tables! > > > > Right. Yes. HTML 4.0. Of course. > http://www.w3.org/TR/REC-html32#table Wasn't that his point? > > The whole situation with HTML at the time was a mess. It didn't help > > that browser vendors ran around implementing , and > > instead of trying to develop something good. So HTML 3 was > > scrapped and HTML 3.2 came along to document what they had some up with. > > So, as you see, they were not capable of even dealing with such a > fundamental need like tables > at the time, but you expect them to address things like how to manipulate > the DOM?! Tables were in HTML 3.2 as well as in the 1995 HTML 3.0 proposals, which Netscape implemented a good chunk of. > > > W3C recommended "document.getElement" a month before 2001, while > > > IE4-was allready three years old and running. > > > > Incorrect, see above. > > Correct all the way, as you can see from above too. -They should have used > the same policy as they > did with other coding practices and embrace what was allready a standard in > the coding "world". If it > weren't for them taking sides... Wrong, as I explained above. DOM1HTML and DOM1Core contained the getElement{sByTagName|ById|sByName} methods in 1998 already. > For more than three years, coders around the world got used to "MyElement" > solution with no alternative > recommendation. Accusing IE for being non-compliant is a pure demagogy. Actually, Microsoft has a better alternative solution in document.all. Netscape and DOM1HTML had the purpose specific collections that IE3 copied from Netscape2/3. Microsoft didn't have to expose elements with names or ids as global variables for backwards compatibility, there was already a precedent of using collections on the Document which they and Netscape both supported, so introducing the global variables for each and every element with name or id was entirely unnecessary. It just broke code... > One can not write you a ticket for exceeding speed-limit yesterday while > driving 70mph, simply because > today the speed limit for that road is reduced to 60mph by God himself, > shortly known as W3C & his felow > cancelor FX. True. Microsoft simply made a bad decision and in the process prevented Netscape from doing corrections to their slightly broken early designs by demanding that everything they both implemented was kept as-is. > > > So it was, still is, and allways will be, W3C. > > Mean time, while W3C was holding back the web, coders turned to using Flash > and other plugin alternatives > filling the vacuume they (W3C) almost puposedly created. In 2001 flash > couldn't do anything more fancier > than IE4.1 filters could do, -today html and scripting has become a simple > tool for hidding url's of flash > content from pages that every day more and more rely on third party > plugins. There are 30% of pages completely > built in flash. Other 40% are hybrids, and all because W3C is still holding > back the web... The W3C wasn't holding back the web by any measure. What held back the web was: 1. Netscape scrapping version 5 thereby giving Microsoft years of calm to marginalise them. 2. Netscape releasing version 6 before it was production quality, thus throwing the last chance they had at using their old-but-not-forgotten, well-liked brand by making it an old-and forgotten-except-by-those-that-dislike-it brand. 3. Microsoft stopping any resemblance of progress in browser space. 4. Total domination of the W3C activities by non-browser-makers. Browser makers are regaining dominance in W3C activities. The HTML5 WG, WebAPI WG, CSS WG, SVG WG and others have been started or in some cases finally woken up and begun pushing technologies that have end-users, live content and browser implementation interoperability as priorities instead of walled garden enterprise specs such as the WS-* space, the mobile forum WAP space etc. And that's not the only part of the web standards world that has been revived. TG1, or TC39, is living and making progress on ECMAScript 4. (And ECMAScript 3.1/3.x). In IETF the HTTP people are working too. And most of all, browsers have actually begun pushing the borders of web technology forwards again. Because on the web, the ultimate decision maker for which technology survives and which dies is the user, and the browser is the gatekeeper. -- David "liorean" Andersson From liorean at gmail.com Sat Apr 19 12:34:28 2008 From: liorean at gmail.com (liorean) Date: Sat, 19 Apr 2008 19:34:28 +0200 Subject: [Javascript] Microsoft proprietary DOM vs Standards (Was: IE work-a-round question (re: checkbox In-Reply-To: References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <4800D690.2040804@internetique.com> <1F71AA0A-C332-4528-A49A-DA1A042D1E77@dorward.me.uk> <3A03F77B-73A7-4C3B-A490-54BE603BC0E3@dorward.me.uk> Message-ID: On 19/04/2008, liorean wrote: > Tables were in HTML 3.2 as well as in the 1995 HTML 3.0 proposals, > which Netscape implemented a good chunk of. > > Errr, or course. -- David "liorean" Andersson From davidh126 at writeme.com Sat Apr 19 15:54:42 2008 From: davidh126 at writeme.com (David Hucklesby) Date: Sat, 19 Apr 2008 13:54:42 -0700 Subject: [Javascript] IE onclick problem In-Reply-To: Message-ID: <2008419135442.724425@DAVIDS> On Sat, 19 Apr 2008 12:14:57 -0400, tedd wrote: [...] > > How can you have an unobtrusive onsubmit function tied to an unique id form on a > document that contains several forms -- such that IF its submit button is clicked, then > that form is processed (i.e., evaluated for content) while not processing the other > forms? > > Now, I can do this with an in-line: > > onsubmit="return checkForm(this);" > > for each form, but how do you do that and be unobtrusive? > Use an "addEvent()" function, perhaps? Cordially, David -- From dshaw256 at earthlink.net Sun Apr 20 13:52:58 2008 From: dshaw256 at earthlink.net (Dave Shaw) Date: Sun, 20 Apr 2008 14:52:58 -0400 Subject: [Javascript] Two questions about AJAX Message-ID: <1208717578.4952.9.camel@localhost.localdomain> Hi! Pardon me if this is repetitive. I'm new to AJAX and have a couple of questions to which I have not been able to find answers by searching the 'net. First, must I use a new XMLHttpRequest object for each interaction with my server, or can one such object be reused for multiple interactions? Second, the first time I tried using AJAX I managed to kick off two requests simultaneously, using two XMLHttpRequest objects, two onreadystatechange functions, etc. I was using Internet Explorer 7, and this worked fine. But when I tried the same page using Firefox, one or the other request would complete but the other would fail. I recoded to ensure that the requests would be issued serially. But in general, should I be able to have multiple asynchronous requests outstanding at the same time, or should I ensure that there is only one request pending at a time? Thanks much for the help! Dave Shaw -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwarden at gmail.com Sun Apr 20 14:33:37 2008 From: mwarden at gmail.com (Matt Warden) Date: Sun, 20 Apr 2008 15:33:37 -0400 Subject: [Javascript] Two questions about AJAX In-Reply-To: <1208717578.4952.9.camel@localhost.localdomain> References: <1208717578.4952.9.camel@localhost.localdomain> Message-ID: On Sun, Apr 20, 2008 at 2:52 PM, Dave Shaw wrote: > First, must I use a new XMLHttpRequest object for each interaction with my > server, or can one such object be reused for multiple interactions? You are supposed to use a new object for each interaction. It is abstracting a "request", after all. However, from a purely technical possibility perspective, there are browser differences with whether you can re-use the object or not. See this thread from May 2005 (FYI the sandbox link referred to in the thread is now at http://mattwarden.com/sandbox/ajax.htm): http://lists.evolt.org/archive/Week-of-Mon-20050516/172540.html > Second, the first time I tried using AJAX I managed to kick off two > requests simultaneously, using two XMLHttpRequest objects, two > onreadystatechange functions, etc. I was using Internet Explorer 7, and this > worked fine. But when I tried the same page using Firefox, one or the other > request would complete but the other would fail. I recoded to ensure that > the requests would be issued serially. But in general, should I be able to > have multiple asynchronous requests outstanding at the same time, or should > I ensure that there is only one request pending at a time? You can definitely have 2 outstanding asynchronous requests at one time. A July 05 article presents a method for dealing with any number of outstanding requests at a given time (although the browser typically restricts the number of outstanding requests to the same host, due to a suggestion in the http specification). The idea I put forth in this article is largely irrelevant now, because few people operate with AJAX directly without a library anymore: http://www.devx.com/webdev/Article/28695 -- Matt Warden Cincinnati, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy. From hjess at cardomain.com Mon Apr 21 10:54:08 2008 From: hjess at cardomain.com (Howard Jess) Date: Mon, 21 Apr 2008 08:54:08 -0700 Subject: [Javascript] IE onclick problem In-Reply-To: References: Message-ID: <480CB8A0.6080302@cardomain.com> > Another question -- what if you have two forms? > > window.onload=function() > { > var form=document.getElementById('a'); > function submitter() > { > return checkForm(form) > } > form.onsubmit = submitter; > var form=document.getElementById('b'); > function submitter() > { > return checkForm(form) > } > form.onsubmit = submitter; > } > > Doesn't work for two forms. I think it's time for you to get and read a good book on JavaScript, where most of your questions will likely be answered; specifically, anonymous functions (lambdas) and closures. I'd suggest Flanagan's _JavaScript_The_Definitive_Guide_. In short, window.onload=function() { var form1 = document.getElementById('a'); var form2 = document.getElementById('b'); form1.onsubmit = function() { return checkform(form1); } form2.onsubmit = function() { return checkform(form2); } } Or, as David Hucklesby implied, use DOM2 events: form1.addEventListener('submit',formcheck,false); form2.addEventListener('submit',formcheck,false); (leaving code for IE and the formcheck function as an exercise for the reader.) -- hj From tedd at sperling.com Mon Apr 21 13:20:26 2008 From: tedd at sperling.com (tedd) Date: Mon, 21 Apr 2008 14:20:26 -0400 Subject: [Javascript] IE onclick problem In-Reply-To: <480CB8A0.6080302@cardomain.com> References: <480CB8A0.6080302@cardomain.com> Message-ID: At 8:54 AM -0700 4/21/08, Howard Jess wrote: >I think it's time for you to get and read a good book on JavaScript, >where most >of your questions will likely be answered; specifically, anonymous functions >(lambdas) and closures. I'd suggest Flanagan's >_JavaScript_The_Definitive_Guide_. > >In short, > > window.onload=function() { > var form1 = document.getElementById('a'); > var form2 = document.getElementById('b'); > form1.onsubmit = function() { > return checkform(form1); > } > form2.onsubmit = function() { > return checkform(form2); > } > } > >Or, as David Hucklesby implied, use DOM2 events: > > form1.addEventListener('submit',formcheck,false); > form2.addEventListener('submit',formcheck,false); Ahhh, you are right of course. I don't know why I didn't see that. Thanks for the education. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From riegel at clearimageonline.com Mon Apr 21 16:27:24 2008 From: riegel at clearimageonline.com (Terry Riegel) Date: Mon, 21 Apr 2008 17:27:24 -0400 Subject: [Javascript] IE work-a-round question (re: checkboxes) OT In-Reply-To: <034f01c89ce5$5bf8e060$13eaa120$@com> References: <12fcb13ce6b042c6af170e879873b99c@maila15.webcontrolcenter.com> <034f01c89ce5$5bf8e060$13eaa120$@com> Message-ID: <8CE682D7-6598-4E22-A08D-8DEB84000A13@clearimageonline.com> > What puzzles me is why anyone would set out to code to 30% of > browsers and then tweak to fit 70%, seems backwards to me. I can answer why I code for the 30% then make the 70% work. Because it takes less time. For the most part MS is standards compliant. But, If I code to a "more" standards compliant browser (in my case Safari) then my fixes for a "less" compliant browser will take less time then if I did it in reverse. For example if I use a lot of MS only functions then how do I retrofit that to the browser that tries to follow the standard. Or to look at it another way... Why did Quicken require Microsoft's Internet Explorer to run? Because they coded to IE and it was to much work to try to make the other browsers work. But if they had coded for a more standards compliant browser then making IE work would have been a breeze. (BTW this is no longer true of Quicken for the web, but at one time it was true) Just my 2 cents. Terry Riegel -------------- next part -------------- An HTML attachment was scrubbed... URL: From tedd at sperling.com Tue Apr 29 13:23:44 2008 From: tedd at sperling.com (tedd) Date: Tue, 29 Apr 2008 14:23:44 -0400 Subject: [Javascript] A better way to do this Message-ID: Hi gang: There has to be a better way to do this: function checkAll( form ) { if(form.checkall.checked) { form.a1.checked = true; form.a2.checked = true; form.a3.checked = true; form.a4.checked = true; form.a5.checked = true; } else { form.a1.checked = false; form.a2.checked = false; form.a3.checked = false; form.a4.checked = false; form.a5.checked = false; } } What say you? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com From js0000 at gmail.com Tue Apr 29 13:53:20 2008 From: js0000 at gmail.com (john saylor) Date: Tue, 29 Apr 2008 14:53:20 -0400 Subject: [Javascript] A better way to do this In-Reply-To: References: Message-ID: hi On 4/29/08, tedd wrote: > There has to be a better way to do this: there are [probably more than one] ... put all the form objects into an array and loop through them setting their checked status to form.checkall.checked. -- \js [ http://or8.net/~johns/ ] From mwarden at gmail.com Tue Apr 29 13:53:23 2008 From: mwarden at gmail.com (Matt Warden) Date: Tue, 29 Apr 2008 14:53:23 -0400 Subject: [Javascript] A better way to do this In-Reply-To: References: Message-ID: On Tue, Apr 29, 2008 at 2:23 PM, tedd wrote: > Hi gang: > > There has to be a better way to do this: > > function checkAll( form ) > { > if(form.checkall.checked) > { > form.a1.checked = true; > form.a2.checked = true; > form.a3.checked = true; > form.a4.checked = true; > form.a5.checked = true; > } > else > { > form.a1.checked = false; > form.a2.checked = false; > form.a3.checked = false; > form.a4.checked = false; > form.a5.checked = false; > } > } Making some minor assumptions about your local variable names and the elements in the form, I might suggest (untested)... for (var i=0; i References: Message-ID: <48176ECD.5040309@internetique.com> >>There has to be a better way to do this: Try this (not checked): function checkAll( form ) { for (var i = 1; i<= 5; i++)form['a'+i].checked = form.checkall.checked } -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon at internetique.com) Thanks. From alaneaston666 at hotmail.com Wed Apr 30 18:48:18 2008 From: alaneaston666 at hotmail.com (Alan Easton) Date: Thu, 1 May 2008 00:48:18 +0100 Subject: [Javascript] IE/FF, getElementById and checkboxes Message-ID: Hi All, I have some validation that works in IE, for when I need to check if any checkboxes are checked in my form. If there are, then I submit the form. Code is below: ------------------------------------------------ Example checkbox field: All are called "delusers", and have different values. Now I know I need to ad "id"'s to all of these, but I am still having trouble. ------------------------------------------------ However this is not working in FF. I know I need to change to use getElementById, but the two lines highlighted above are causing me problems. Any help would be appreciated in order so the validation works in IE and Ff. Thanks, Alan... _________________________________________________________________ Play the Andrex Hello Softie Game & win great prizes http://www.thehellosoftiegame.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From hassan at webtuitive.com Wed Apr 30 19:50:45 2008 From: hassan at webtuitive.com (Hassan Schroeder) Date: Wed, 30 Apr 2008 17:50:45 -0700 Subject: [Javascript] IE/FF, getElementById and checkboxes In-Reply-To: References: Message-ID: <481913E5.8000508@webtuitive.com> Alan Easton wrote: 1. problems in Firefox? install Firebug. now. :-) 2. can't identify a failure? wrap everything in a try/catch block and alert it -- hard to miss, and it stops a failed form submission on the spot >