Prev: FAQ Topic - Internationalisation and Multinationalisation in javascript. (2010-03-23)
Next: FAQ Topic - How do I format a Date object with javascript? (2010-03-28)
From: johnwlockwood on 29 Mar 2010 09:51 On Mar 29, 12:10 am, David Mark <dmark.cins...(a)gmail.com> wrote: > > So I'm thinking of using JSON and dynamic <script> tags as described > > onhttp://developer.yahoo.com/javascript/howto-proxy.htmlto pass this > > text, then the JSON response would do the callback thing initiating > > the code that requests the next part of the content. If the content > > was too long to be passed in one piece via a get request, it could be > > broken up and after each round trip, it would add another script > > element pushing the next piece. > > Using a proxy seems like the sensible approach. I would use the non-proxy method as described in the Other Solutions part of this page. If I did a proxy for any site, I would have to communicate to my server that I wanted them to go to a page on my domain, than load the page they were on in a under my domain. This wouldn't work if the site required registration to view that page's content, would it? > > > > > The application would use a session cookie to connect the pieces with > > a user and an id code to connect the pieces together. > > I wouldn't do it quite that way and unfortunately a confidentiality > agreement prohibits me from telling you how I would do it. Ask me about > any other application. :) You tease. :) are you referring to just this last statement, or the whole post? Well, once I implement it, I may find problems with this last part or think of a better way, but in the end I must suffer with the solution I come up with. -John
From: Hans-Georg Michna on 29 Mar 2010 10:33 On Sun, 28 Mar 2010 12:35:44 -0700 (PDT), Sean Kinsey wrote: >On Mar 28, 9:30�pm, Hans-Georg Michna <hans- >georgNoEmailPle...(a)michna.com> wrote: >> Just looked at the web site and found it liberally sprinkled >> with a picture of a JavaScript routine for String.prototype.trim >> that embarrassingly uses two .replace calls where one would >> suffice. >Nice one, attack the images I'm temporarily using on the website, and >a few .replace calls... >Real grown up... No worries, I'm not really hostile. It just looked strage to me, and you may want to change that picture, because others may stumble over this as well. I mean, if I display a piece of code all over the place, it might as well be an elegant, highly optimized one that is not trivial or obvious. As to your library, I sympathize with you---have used a hack involving window.top.name myself already and found it quite funny. For the more serious web sites I would prefer a proxy solution though, as shown in http://winhlp.com/node/699 . Your library may become better over time on its own, if and when old browsers die out. Hans-Georg
From: johnwlockwood on 29 Mar 2010 11:03 On Mar 29, 8:51 am, johnwlockwood <johnwlockw...(a)gmail.com> wrote: > On Mar 29, 12:10 am, David Mark <dmark.cins...(a)gmail.com> wrote: > > > > So I'm thinking of using JSON and dynamic <script> tags as described > > > onhttp://developer.yahoo.com/javascript/howto-proxy.htmltopass this > > > text, then the JSON response would do the callback thing initiating > > > the code that requests the next part of the content. If the content > > > was too long to be passed in one piece via a get request, it could be > > > broken up and after each round trip, it would add another script > > > element pushing the next piece. > > > Using a proxy seems like the sensible approach. > > I would use the non-proxy method as described in the Other Solutions > part of this page. > If I did a proxy for any site, I would have to communicate to my > server that I wanted them to go to a page on my domain, than load the > page they were on in a under my domain. This wouldn't work if the site > required registration to view that page's content, would it? ooh, as they would be logged in to that site, I could send the source site's cookies to my application and access as if the app was the user. -John
From: Bart Van der Donck on 30 Mar 2010 04:40 Mahdi Rad wrote: > for example there is site with addresswww.X.com, that has theprice > of some product: > <div id="product1">price: 100$</div> > now I wanna make sitewww.Y.comand then, I wanna read thepriceof > product1 which is in the sitewww.X.com > we can read the value in the html site with javascript command like > this: > String s = document.getElementById("product1").value > but how can we read this value in out of that site? > > the improtant thing is : do it with code, beucause I wanna update my > site automatically I don't want to toot my own horn, but I believe Ajax Cross Domain can help you: 1. Load the body of X.com from Y.com 2. Extract the desired div from it 3. Use the value further at Y.com www.ajax-cross-domain.com -- Bart
From: Hans-Georg Michna on 30 Mar 2010 10:51
On Tue, 30 Mar 2010 01:40:58 -0700 (PDT), Bart Van der Donck wrote: >I don't want to toot my own horn, but I believe Ajax Cross Domain can >help you: >1. Load the body of X.com from Y.com >2. Extract the desired div from it >3. Use the value further at Y.com > >www.ajax-cross-domain.com Why the unnecessary complexity of a Perl server service? Why not simply use a very light proxy server, as shown in http://winhlp.com/node/699 ? To provide such a service for the public is nice, but would it stand up to worldwide use? Probably not. People would have to set up their own services, and then I fail to see the advantage over a simple proxy server. Or am I overlooking something? Hans-Georg |