BeeRich
2007-Jun-22 06:52 UTC
Shoving new JS/functions into ajax.updater response...not working
Hi folks. I built a functioning ajax.updater. I was a happy guy. Everything worked. Then I wanted to enter a button for Digg, which is presented in the following way: <script type="text/javascript"> digg_url = ''http://domain.com/library.rbf?id=5''; digg_bgcolor = ''#c9cc67''; digg_skin = ''compact''; </script> <script src="http://digg.com/tools/diggthis.js" type="text/ javascript"></script> But for some reason, none of this will be entered into the response from my original ajax.updater. Someone on a list said to try evalScripts:true, but that didn''t change anything. The new library on the bottom is remote, and is not mind. It''s a Digg button that is supposed to show up, but all of this syntax is completely missing, and I don''t know why. Any ideas appreciated. Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Matt
2007-Jun-22 17:55 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
Try using Ajax.Request for more logic specific requests, Ajax.Updater is a convienence class to help with requests that are simply plugging HTML into an object. On Jun 22, 2:52 am, BeeRich <beer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi folks. > > I built a functioning ajax.updater. I was a happy guy. Everything > worked. > > Then I wanted to enter a button for Digg, which is presented in the > following way: > > <script type="text/javascript"> > digg_url = ''http://domain.com/library.rbf?id=5''; > digg_bgcolor = ''#c9cc67''; > digg_skin = ''compact''; > </script> > <script src="http://digg.com/tools/diggthis.js" type="text/ > javascript"></script> > > But for some reason, none of this will be entered into the response > from my original ajax.updater. Someone on a list said to try > evalScripts:true, but that didn''t change anything. > > The new library on the bottom is remote, and is not mind. It''s a Digg > button that is supposed to show up, but all of this syntax is > completely missing, and I don''t know why. > > Any ideas appreciated. > > Cheers--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BeeRich
2007-Jun-24 01:08 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
On Jun 22, 1:55 pm, Matt <mattfoste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try using Ajax.Request for more logic specific requests, Ajax.Updater > is a convienence class to help with requests that are simply plugging > HTML into an object.That''s exactly what I''m trying to do. It won''t shove any JS at all, only returning the syntax around it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BeeRich
2007-Jun-24 01:11 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
On Jun 22, 1:55 pm, Matt <mattfoste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try using Ajax.Request for more logic specific requests, Ajax.Updater > is a convienence class to help with requests that are simply plugging > HTML into an object.That is exactly what I am trying to do. The replaced DIV has a bit of JS in it, 6 lines, and it isn''t showing up. The syntax above and below it, are showing up fine. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
David Dashifen Kees
2007-Jun-24 02:31 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
Have you read the docs which talk about how to get functions to work within information retrieved from a Ajax request? If not, check it out here: http://www.prototypejs.org/api/ajax/updater. Just look for the header "About evalScripts and defining functions" a little bit down the page. - Dave - BeeRich wrote:> > On Jun 22, 1:55 pm, Matt <mattfoste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Try using Ajax.Request for more logic specific requests, Ajax.Updater >> is a convienence class to help with requests that are simply plugging >> HTML into an object. >> > > That is exactly what I am trying to do. The replaced DIV has a bit of > JS in it, 6 lines, and it isn''t showing up. The syntax above and > below it, are showing up fine. > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BeeRich
2007-Jun-25 00:06 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
On Jun 23, 10:31 pm, David Dashifen Kees <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Have you read the docs which talk about how to get functions to work > within information retrieved from a Ajax request? If not, check it out > here: http://www.prototypejs.org/api/ajax/updater. Just look for the > header "About evalScripts and defining functions" a little bit down the > page.Hi Dave. I have tried that. Others have suggested it. It doesn''t work. Either the evaluation doesn''t pass, or something else is wrong. I''ve made an example and it too doesn''t work. The digg.js doesn''t seem to pass the "evaluation", but it''s not my code. So I can''t change it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
tobie
2007-Jun-25 00:17 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
Try this: <script type="text/javascript"> digg_url = ''http://domain.com/library.rbf?id=5''; digg_bgcolor = ''#c9cc67''; digg_skin = ''compact''; var script = document.createElement(''script''); script.type = ''text/javascript''; script.charset = ''utf-8''; script.src = ''http://digg.com/tools/diggthis.js''; document.getElementsByTagName(''head'')[0].appendChild(script); </script> On Jun 24, 8:06 pm, BeeRich <beer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 23, 10:31 pm, David Dashifen Kees <dashi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Have you read the docs which talk about how to get functions to work > > within information retrieved from a Ajax request? If not, check it out > > here: http://www.prototypejs.org/api/ajax/updater. Just look for the > > header "About evalScripts and defining functions" a little bit down the > > page. > > Hi Dave. I have tried that. Others have suggested it. It doesn''t > work. Either the evaluation doesn''t pass, or something else is > wrong. I''ve made an example and it too doesn''t work. The digg.js > doesn''t seem to pass the "evaluation", but it''s not my code. So I > can''t change it.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
tobie
2007-Jun-25 00:20 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
I forgot one thing: to make sure your variables are global: <script type="text/javascript"> window.digg_url = ''http://domain.com/library.rbf?id=5''; window.digg_bgcolor = ''#c9cc67''; window.digg_skin = ''compact''; var script = document.createElement(''script''); script.type = ''text/javascript''; script.charset = ''utf-8''; script.src = ''http://digg.com/tools/diggthis.js''; document.getElementsByTagName(''head'')[0].appendChild(script); </script> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
jdalton
2007-Jun-25 02:42 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
Safari 2.0 has issues with inserting script elements. You may want to use the method Scriptaculous uses. // inserting via DOM fails in Safari 2.0, so brute force approach document.write(''<script type="text/javascript" src="'' + libraryName + ''"></script>''); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
jdalton
2007-Jun-25 02:43 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
P.S. - eval scripts is to eval raw JavaScript code via eval(); not used to dynamically include external js files. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
tobie
2007-Jun-25 05:31 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
Works for me in Safari 2. As it''s the basis of JSON XSS, I would have been very, very surprised if it hadn''t. Obviously, as this is an ajax request, a call to document.write is impossible (it would clear the document!). I''m actually wondering which version of Safari had issues with this technique. Thomas, if you bump into this thread, could you enlighten us ? Thanks, Tobie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BeeRich
2007-Jun-25 17:13 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
On Jun 24, 8:20 pm, tobie <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I forgot one thing: to make sure your variables are global: > > <script type="text/javascript"> > window.digg_url = ''http://domain.com/library.rbf?id=5''; > window.digg_bgcolor = ''#c9cc67''; > window.digg_skin = ''compact''; > > var script = document.createElement(''script''); > script.type = ''text/javascript''; > script.charset = ''utf-8''; > script.src = ''http://digg.com/tools/diggthis.js''; > > document.getElementsByTagName(''head'')[0].appendChild(script); > </script>Thanks for the reply. Adding anything to the item that isn''t being displayed won''t help anything. That script isn''t the issue. The ajax.updater won''t display any JS in the response, that I can find. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BeeRich
2007-Jun-25 17:15 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
Ah, I did not know that. I''m finding the same with Firebox 2.0.0.4. But thanks for the heads up. I''ll look into that. Cheers On Jun 24, 10:42 pm, jdalton <jdalton...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Safari 2.0 has issues with inserting script elements. > You may want to use the method Scriptaculous uses. > > // inserting via DOM fails in Safari 2.0, so brute force approach > document.write(''<script type="text/javascript" src="'' + libraryName > + ''"></script>'');--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BeeRich
2007-Jun-25 17:18 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
On Jun 25, 1:31 am, tobie <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Works for me in Safari 2. As it''s the basis of JSON XSS, I would have > been very, very surprised if it hadn''t. > > Obviously, as this is an ajax request, a call to document.write is > impossible (it would clear the document!). > > I''m actually wondering which version of Safari had issues with this > technique.I am using 2.0.4 on Mac, and Firefox 2.0.0.4 as well, on Mac. Neither will display this. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
tobie
2007-Jun-25 17:29 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
Actually, I looked at the code that''s included in the js file hosted by digg. There is now way you can include it inside a page with an ajax request as it contains a call to document.write. This completely erase you page. There isn''t a solution to this issue except asking digg to modify their script. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
BeeRich
2007-Jun-30 06:40 UTC
Re: Shoving new JS/functions into ajax.updater response...not working
On Jun 25, 1:29 pm, tobie <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Actually, I looked at the code that''s included in the js file hosted > by digg. > > There is now way you can include it inside a page with an ajax request > as it contains a call to document.write. > > This completely erase you page. > > There isn''t a solution to this issue except asking digg to modify > their script.Ya I thought so. Not good. Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---