tag:blogger.com,1999:blog-8112154.post110551771284302335..comments2024-03-29T15:37:10.515+05:30Comments on blog.rakeshpai.me: Why XML in XmlHTTPRequest?Rakesh Paihttp://www.blogger.com/profile/00328152982823663876noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-8112154.post-77284577155410027472022-07-28T06:14:21.222+05:302022-07-28T06:14:21.222+05:30Why you hack my account,what is the reasonWhy you hack my account,what is the reasonAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-37548285186889930252010-06-18T18:30:09.647+05:302010-06-18T18:30:09.647+05:30How will this handle the data which has image also...How will this handle the data which has image also in it?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-16430353501045099362007-05-24T18:30:00.000+05:302007-05-24T18:30:00.000+05:30Anonymous, did you find a way to use your method i...Anonymous, did you find a way to use your method in a synchronous way?<BR/><BR/>Regards wizardnetAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-81196187937756210702007-02-14T22:38:00.000+05:302007-02-14T22:38:00.000+05:30William,This post assumes that JavaScript is avail...William,<BR/><BR/>This post assumes that JavaScript is available, which is around 96% of the typical Internet audience.<BR/><BR/>In case you are concerned about cases where users do not have JavaScript enabled, you should find out more about "Unobtrusive JavaScript" and "Graceful Degradation" techniques. It is a little harder, but not impossible, to cater to users that don't have JavaScript enabled.Rakesh Paihttps://www.blogger.com/profile/00328152982823663876noreply@blogger.comtag:blogger.com,1999:blog-8112154.post-35326101245103545082007-02-14T14:24:00.000+05:302007-02-14T14:24:00.000+05:30but what if javascript is off?but what if javascript is off?willhttps://www.blogger.com/profile/01492320950442627782noreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1124754189790239002005-08-23T05:13:00.000+05:302005-08-23T05:13:00.000+05:30Just want to say, most helpful article for me. I'v...Just want to say, most helpful article for me. I've been struggling to get decent performance for a week, bashing my XML-reading code this way and that. Switching to eval was a perfect solution for getting thousands of records into my Javascript in a tolerable timeframe. Magic.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1123085195145658782005-08-03T21:36:00.000+05:302005-08-03T21:36:00.000+05:30You may be get some information about XMLHttpReque...You may be get some information about XMLHttpRequest at the http://mcoder.atspace.orgAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1113840307289181612005-04-18T21:35:00.000+05:302005-04-18T21:35:00.000+05:30The idea of outputting lots of javascript directly...The idea of outputting lots of javascript directly from server side code is a bit of a false economy due to changes in javascript requiring rebuilding solutions. Combining with XSLT on the server side can give the flexibility to change without having to rebuild solutions, And also means you can output HTML directly.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1108101613575463522005-02-11T11:30:00.000+05:302005-02-11T11:30:00.000+05:30Interesting technique, Anonymous. (I wish you'd le...Interesting technique, Anonymous. (I wish you'd leave your name, but really that is Blogger's fault - I understand.)<br /><br />The next obvious question would be, is it better to eval a string, or better to parse a string and decide what client-side function to call? Which one is more efficient? Which one is faster? Which one would reduce memory leaks (which is increasingly becoming an issue with JS web apps)?<br /><br />I'd think that for small scripts that essentially have very few callbacks, your technique would reign supreme. However for larger scripts with more callbacks, parsing the response string to determine the operation would be just as performance intensive as using eval, what with complex if-else ladders.<br /><br />Of course, that's off the top. I have not tested it, nor could I come across anyone who has. Can anyone shed some light on this matter?Rakesh Paihttps://www.blogger.com/profile/00328152982823663876noreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1108099934070856492005-02-11T11:02:00.000+05:302005-02-11T11:02:00.000+05:30>>am i missing something
Yes, don't send the func...>>am i missing something<br /><br />Yes, don't send the function name from the server, just the string and then send that to the function:<br /><br />clientsideRPCFunction(serverResponseString);<br /><br />Or you can set the callback function beforehand if sending an ID back and forth, or send the function name itself back and forth as the first argument, but that involves more coding obviously.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1106799652752896502005-01-27T09:50:00.000+05:302005-01-27T09:50:00.000+05:30Whether this is new or not doesn't really matter. ...Whether this is new or not doesn't really matter. Fact is, it is very underutilized. Which seems to be the case for various reasons:<br /><br />1) noone seems to be able to come up with something that has decent cross-browser support.<br />2) the odd assumption that payloads will be XML<br />3) the apparent cross-domain restriction of hmlhttprequest<br /><br />Can someone just put together some code that's reasonably cross platform that can do simple POSTs or GETs, ideally to any domain?pathttps://www.blogger.com/profile/16386131080190364703noreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1106290440118859482005-01-21T12:24:00.000+05:302005-01-21T12:24:00.000+05:30>> why not just send the data string and and call ...>> why not just send the data string and and call the function with it? No eval needed.<br /><br />How would that work? Let's take the code in question in my post. The server returns the string which is basically that sendRPCDone function call. When that is received by the client as a result of the XmlHTTPRequest response, it'll be for all practical purposes just a piece of string. How do you get it to be treated as a piece of client-side code and execute it, without using eval? <br /><br />Am I missing something?Rakesh Paihttps://www.blogger.com/profile/00328152982823663876noreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1106275502942654982005-01-21T08:15:00.000+05:302005-01-21T08:15:00.000+05:30>>It should work with any W3C-DOM browser.
-not Sa...>>It should work with any W3C-DOM browser.<br />-not Safari. Not old Opera either. Maybe newest, forget offhand. I've used it for ages to send items to the shopping cart when ordering and works pretty well. (Btw, your code needs a timestamp added so not cached by IE. Also IE Mac needs a different routine; you'll crash it with that code.)<br /><br />>>(eval() is JavaScripts most performance deficient function).<br />-why not just send the data string and and call the function with it? No eval needed.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8112154.post-1106191630193667092005-01-20T08:57:00.000+05:302005-01-20T08:57:00.000+05:30Wow, Adam. That piece of code is poetry!
I was ju...Wow, Adam. That piece of code is poetry!<br /><br />I was just thinking the other day about dynamically including JavaScript files, and XmlHTTPRequest wasn't the solution to it (or was too clumsy at best).<br /><br />Your code, on the other hand, is just what I was looking for. Awesome work!Rakesh Paihttps://www.blogger.com/profile/00328152982823663876noreply@blogger.com