tag:blogger.com,1999:blog-34454975.post9134600842609139478..comments2023-06-28T16:58:41.189+02:00Comments on Web Reflection: My Last DOMContentLoaded SolutionAndrea Giammarchihttp://www.blogger.com/profile/16277820774810688474noreply@blogger.comBlogger36125tag:blogger.com,1999:blog-34454975.post-50799410745034684902014-03-25T05:17:55.099+01:002014-03-25T05:17:55.099+01:00yes, forget whatever you are using in there and pu...yes, forget whatever you are using in there and put <a href="https://github.com/WebReflection/dom4#dom4" rel="nofollow">DOM4</a> before any script that trusts DOMContentLoaded ;-)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-64377236800135063932014-03-25T04:52:00.560+01:002014-03-25T04:52:00.560+01:00Hi Andrea,
I have a very old web project which is...Hi Andrea,<br /><br />I have a very old web project which is using your code (http://www.3site.eu/jstests/onContent/final.html)<br /><br />and I found there is console exception<br /><br />Uncaught TypeError: Object function (){a[c]=function(){};for(a=arguments.callee;!a.done;a.done=1)f(o?o():o)} has no method 'onContent' <br /><br /><br />Any hints to fix it? Thanks!Wilsonthttps://www.blogger.com/profile/10677855196293402302noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-66438151782618393072008-01-20T13:23:00.000+01:002008-01-20T13:23:00.000+01:00Dear ND, of course you can but I think you should ...Dear ND, of course you can but I think you should better view last jQuery implementation that uses the most common and tested solution for this kind of problem.<BR/><BR/>Cheers,<BR/>AndreaAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-85825487987353110292008-01-20T12:54:00.000+01:002008-01-20T12:54:00.000+01:00Dear Andrea,Can I copy this code under the terms o...Dear Andrea,<BR/><BR/>Can I copy this code under the terms of the MIT license?<BR/>This is the license under which Dean Edwards released his code.<BR/><BR/>Thanks for the solution.<BR/><BR/>Cheers,<BR/><BR/>NDAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-32663156283057959102007-06-10T11:34:00.000+02:002007-06-10T11:34:00.000+02:00hey, I've started a similar approach, namely whenD...hey, I've started a similar approach, namely <A HREF="http://en.design-noir.de/webdev/JS/whenDOMReady/" REL="nofollow">whenDOMReady</A>.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-60957553822223152372007-04-12T12:02:00.000+02:002007-04-12T12:02:00.000+02:00Please review your tests.Please show us your test ...<I>Please review your tests.</I><BR/>Please show us your test casesAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-74744864140503611312007-04-12T03:15:00.000+02:002007-04-12T03:15:00.000+02:00As already said in other places the document.write...As already said in other places the document.write trick is not for all situations, for example it will fail when there are no images in the page, it will fail when the page size is bigger than the images it contains, it will fail (not break but loose it's real scope) if you use this trick in a big js library where the library is bigger than the page itself.<BR/><BR/>In all those cases this trick will miss the bus and the "onload" will fire before of it, making it obsolete.<BR/><BR/>Please review your tests.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-35445616831865713432007-03-27T09:38:00.000+02:002007-03-27T09:38:00.000+02:00Last solution should be this one:http://www.3site....Last solution should be this one:<BR/>http://www.3site.eu/jstests/onContent/onContent.js<BR/><BR/>Bye :)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-33852346353039800062007-03-27T09:13:00.000+02:002007-03-27T09:13:00.000+02:00alla fine qual'e l' ultimissima versione?alla fine qual'e l' ultimissima versione?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-24409715930819874432007-02-13T16:48:00.000+01:002007-02-13T16:48:00.000+01:00ooops ... fixed, thank You :Dooops ... fixed, thank You :DAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-70477847325058572432007-02-13T15:35:00.000+01:002007-02-13T15:35:00.000+01:00Give a look at the year you wrote...2997 !!!!Give a look at the year you wrote...<BR/><B>2997</B> !!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-84696596711351848592007-02-12T21:12:00.000+01:002007-02-12T21:12:00.000+01:00I don't understand what do You mean :E ... however...I don't understand what do You mean :E ... however, ciao Pierluigi ^_^Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-37935252786058550162007-02-12T19:30:00.000+01:002007-02-12T19:30:00.000+01:00Update 01/13/2997 [...]Cavolo, Andrea! Non sapevo ...<I>Update 01/13/2997 [...]</I><BR/><BR/>Cavolo, Andrea! Non sapevo scrivessi per Star Trek ;)))))))))<BR/><BR/>Salutissimi.<BR/>Pierluigi (da 'Edit').Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34454975.post-86801387965376203162007-01-27T20:24:00.000+01:002007-01-27T20:24:00.000+01:00Dear Stefan ... if everyone before You has used do...Dear Stefan ... if everyone before You has used document.write instead of DOM for Internet Explorer ... don't You think that maybe DOM is not usable to add that kind of script with IE browsers ?<br /><br />I don't know what is the problem ... <br /><br />You: <i>I implemented DOMContentLoaded without conditional comments and using the DOM to build the script tag</i><br /><br />Me: <i>this solution doesn't use condictional comments</i><br /><br />You: <i>I could use the DOM in MY implemetation</i><br /><br />Me: ... now ... why everyone want its implementation of the same, <b>just solved</b>, thing ... and why do You think that We are so un-skilled because we've chosed document.write instead of a simple DOM script node ?<br /><br />Starting from Dean Edwards we've tested different solutions from different months ... and the problem is that IE doesn't accept that kind of script node ... then You must use document.write to create that "strange" script tag.<br /><br /><br /><i>Sorry to waste my time</i> ... of course, if You want to rewrite every solution and You want to re-test every problem to find a solution You're right: You waste your time.<br /><br />RegardsAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-46857065123850338612007-01-27T17:16:00.000+01:002007-01-27T17:16:00.000+01:00lol, i give up.
Seems that only Andrea's solution...lol, i give up.<br /><br />Seems that only Andrea's solutions can get commented here.<br /><br />Never said anything about YOUR solution man. But wanted to know if there could be any gotcha's when implementing it otherwise with src empty. I can't read the whole net myself.<br /><br />Why? Because I could use the DOM in MY implemetation. Because //: don't work there. Read it all above.<br /><br />But instead of getting some answers, I get flamed for supposedly attacking Andrea's Ultimate blah blah blah. Where do you read that then? I didn't loose a word about Andrea's thing. I just asked if there were any known issues with my preposition. What's wrong with that? To top it off, I get commented for not reading well?<br /><br />Well, if I can't get a serious answer, I might as well stay out. Sorry to waste my time.Unknownhttps://www.blogger.com/profile/04190615674347075802noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-59267608856225396952007-01-24T16:46:00.000+01:002007-01-24T16:46:00.000+01:00Stefan ... where can You read only one single char...Stefan ... where can You read only one single char of conditional comment inside my solution ?<br /><br />Where do You read that Safari has problems with my soultion ???<br /><br />Maybe You've not see the function as well as You've wrote every comment (2 of them deleted ...)<br /><br />As title: <a href="http://www.3site.eu/jstests/onContent/onContent.js">this is my final, DOMContentLoaded, solution</a> ... bye!Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-46343114774349718192007-01-24T16:13:00.000+01:002007-01-24T16:13:00.000+01:00It's just that I implemented DOMContentLoaded with...It's just that I implemented DOMContentLoaded without conditional comments and using the DOM to build the script tag. And //: without parentheses doesn't work there. So I tried to find something else that works.<br /><br />I liked to know if I would run into trouble with the empty src property. Because I can't test on Mac, and switching WIndows/Linux all the time for a few tests is a pain. So therefore I asked the question.<br /><br />So far I didn't run into trouble with it, but what about Safari? I just thought that a) it could be already been tried out and found to break on certain systems, b) it would be a far faster way to find out any faults.<br /><br />That's why I can't use the best found solution yet, because I use a different technique ;).Unknownhttps://www.blogger.com/profile/04190615674347075802noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-24865928454420445962007-01-23T11:26:00.000+01:002007-01-23T11:26:00.000+01:00ehr ... Stefan, You just have the solution, so wha...ehr ... Stefan, You just have <a href="http://www.3site.eu/jstests/onContent/onContent.js">the solution</a>, so what are You looking for ?<br /><br />The src need to be exactly "//:" ... no void, no false ... only that kind of source because the problem is that IE doesn't accept fake sources over https, it wants to know if source is correct or not (and a javascript source or a false/null/undefined value is not a correct source).<br /><br />What is your problem ? This solution has been <a href="http://svn.dojotoolkit.org/dojo/trunk/src/hostenv_browser.js">adopted by Dojo Toolkit too</a> ... so I suppose it's the best solution, now :-)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-27246301073033482372007-01-22T23:14:00.000+01:002007-01-22T23:14:00.000+01:00I posted some things before that were way behind c...I posted some things before that were way behind current discussions elsewhere, so they got removed. Now that I've catched up on my reading, I still have one question.<br /><br />What's wrong with src="" opposed to src="//:" for https for the IE solution? Tested it out on my server at home and the annoying popup disappeared. Seems I missed something, because there are many posts written about this here and elsewhere.<br /><br />On the other hand, maybe nobody tried it because it was too obvious (altough I really can't believe that :)).<br /><br />Weird thing is it works for http and https, where for example src:"javascript:false" or others did provoce the popup when using https.<br /><br />Surely src="" can't be a solution that only works on my server. And no, I didn't dabble with server settings at all. I even did a second install without modifications (ApacheFriends bundle) to see if there were any differences in behaviour. Nope, nothing different off course.<br /><br />Btw, src="" allows also the use of DOM methods to write the script tag, where src="//:" stopped the IE solution from working.<br /><br />So what do I miss here, or did I really find another solution. Please let me know anyone?Unknownhttps://www.blogger.com/profile/04190615674347075802noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-53022590785532094912007-01-22T03:57:00.000+01:002007-01-22T03:57:00.000+01:00This comment has been removed by the author.Unknownhttps://www.blogger.com/profile/04190615674347075802noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-5624191827234886042007-01-22T03:46:00.000+01:002007-01-22T03:46:00.000+01:00This comment has been removed by the author.Unknownhttps://www.blogger.com/profile/04190615674347075802noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-35205122718873164462007-01-14T17:43:00.000+01:002007-01-14T17:43:00.000+01:00sorry napyfab, it's probably an highlighter proble...sorry napyfab, it's probably an highlighter problem ( I need to update some script of this blog :E )<br /><br /><a href="http://www.3site.eu/jstests/onContent/onContent.js">here</a> you can copy my last version that <a href="http://www.3site.eu/jstests/onContent/final.html">should work correctly</a> :-)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-91819248772986654072007-01-13T21:59:00.000+01:002007-01-13T21:59:00.000+01:00Andrea, your last revision of 01/13/2997 doesn't w...Andrea, your last revision of 01/13/2997 doesn't work.. Error on line 3: missing ) after argument listUnknownhttps://www.blogger.com/profile/00572152275222432594noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-85276696048849998272006-12-01T12:04:00.000+01:002006-12-01T12:04:00.000+01:00The problem, with unsupported browsers, should be ...The problem, with unsupported browsers, should be more than one ... for example, if IE for Mac doesn't work (I can't test them) it writes a script that will never be removed.<br />If safari 1 doesn't work correctly (I can't test them too) it will loop infinitely.<br /><br />I think that if You need absolutely death browsers such IE4, IE 5.2 for Mac, Safari 1 or these kind of old browsers, You shouldn't use onContent but only onload.<br />Then You'll be sure that every browser will support correctly Your script .... however, wich kind of recent script could run inside those old, deprecated browsers ?Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-62799683488978036502006-12-01T11:36:00.000+01:002006-12-01T11:36:00.000+01:00Hi Andrea,
thanks for posting the update, glad to...Hi Andrea,<br /><br />thanks for posting the update, glad to help.<br /><br />I suggested the window.onload fallback because I need to support browsers such as IE4, MacIE5, Safari 1, etc. <br /><br />Having a graceful fallback for these is very useful, though I can understand entirely why you might not want to mix up DOMContentLoaded handlers with onload handlers. <br /><br />As for overwriting existing onload functions, that's a good point but the chained __onContent__ function allows multiple handlers, and if all such handlers are set through this function it is fairly safe. Maybe not one for the general case however :-)<br /><br />Cheers,<br />SteveStephen Elsonhttps://www.blogger.com/profile/08191738853119685969noreply@blogger.com