tag:blogger.com,1999:blog-34454975.post6252130171055439983..comments2023-06-28T16:58:41.189+02:00Comments on Web Reflection: A better JavaScript code evaluation?Andrea Giammarchihttp://www.blogger.com/profile/16277820774810688474noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-34454975.post-31583358657531038812010-08-28T15:54:14.510+02:002010-08-28T15:54:14.510+02:00Thank you for nice explanation.
There is a problem...Thank you for nice explanation.<br />There is a problem using sendRequest function. It doesn't load script(or doesn't have sufficient time to load). Problem gets solved by removing ".parentNode.removeChild(s)" part from the function. I think we should use setTimeOut to remove child.<br /> <br />I tested this behavior with GoogleChrome and IE6(may sound weird but i don't like ie just it came default with Win)<br /><br /> I think by immediate removing of child element we deprive it of having free time to evaluate script.<br />I wander why didn't you notice this or why i have this problem and this makes me think maybe i am wrong because you may have noticed it.Shamil Mehdiyevhttps://www.blogger.com/profile/10149649503330978568noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-28978322638434656832007-08-29T22:23:00.000+02:002007-08-29T22:23:00.000+02:00P.S. .... Peter, I probably didn't understand your...P.S. .... Peter, I probably didn't understand your link ... it was Your problem and Randy is right, you're doing something strange, choosing to use common evaluation functions such eval, execScript or Function and call, or Object.eval that's deprecated, is not a good way while my evalScript proposal is for your specific problem (but I didn't think about that when I wrote them).<BR/><BR/>Well, I hope You'll resolve your problem ;-)Andrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-22874655447272886912007-08-29T22:13:00.000+02:002007-08-29T22:13:00.000+02:00@kentaromiuragood points, so please help me to inv...@kentaromiura<BR/>good points, so please help me to investigate about big dom problems :D<BR/><BR/>@peter<BR/>interesting post, I agree with Randy Webb when He says this sentences:<BR/><I>I have always said that an "AJAX type" site should<BR/>have the backend designed to be handled by AJAX on the client side</I><BR/><BR/>That's was (half implemented) goal of my old PHP / JavaScript ACE project.<BR/><BR/>However, that post talks about "strange or wrong code evaluation" while this one just show a proposal ( and the question mark at the end of the topic is there for a reason ;) ) to load dynamically entire scripts (something like dojo.require should be easily implemented using this function) or parse a bit faster JSON strings loaded using Ajax.<BR/><BR/>This function is not a new way to evaluate code, is just an alternative to run external scripts or parse code quickly.<BR/><BR/>Finally this function works with every browser I tested (IE5+, Safari2+, Opera9+, FireFox 1.5+ ... probably others) but I'm really interesting about one Randy comment inside this post :-)<BR/><BR/>Thank You for this linkAndrea Giammarchihttps://www.blogger.com/profile/16277820774810688474noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-66857810933995843942007-08-29T19:02:00.000+02:002007-08-29T19:02:00.000+02:00For quite some time now, Randy Webb (a comp.lang.j...For quite some time now, Randy Webb (a comp.lang.javascript regular) has been investigating the difficulties of a non-eval script execution. There is a recent thread<BR/><BR/>http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/7120355459a853f1/a3fa38adb6767dd9#a3fa38adb6767dd9<BR/><BR/>and several more in the group's archives. <BR/><BR/>It seems this is a tricky problem.Peter Michauxhttps://www.blogger.com/profile/03727890012987003572noreply@blogger.comtag:blogger.com,1999:blog-34454975.post-2406583112983786122007-08-29T19:00:00.000+02:002007-08-29T19:00:00.000+02:00I'm wandering if this method on the long have side...I'm wandering if this method on the long have side effects, I think it will slow down the DOM tree if not removed, and if the node is removed(like you do) its side effect is that DOM have to be loaded 2 times, on the append and on the remove...on a big page it will slow down much faster that on a lighter one.<BR/><BR/>I think this is not a good way to work,dom shouldn't be touched for any good reason (eval work just fine and using Function you can protect a bit more your global vars), <BR/>although you just raise a good point, and probably it needs more investigation..kentaromiurahttps://www.blogger.com/profile/01628828429767241919noreply@blogger.com