John Cartwright
2007-Jun-15 19:52 UTC
prototype: problem w/ toQueryParams() in version 1.5.1
Hello All, I can''t seem to get toQueryParams() to function in version 1.5.1. Doesn''t seem to be creating a Hash. The following produces no results. I understood there were some issues w/ this in earlier versions, but that they had been resolved in 1.5+. Can someone help me? Thanks! --john var webParams = ''section=blog&id=45''.toQueryParams(); webParams.each(function(pair) {alert(pair.key+'' => ''+pair.value);}); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It doesn''t creat a Hash, it creates an object. You''ll have to convert it to a hahs using $H() or new Hash() like so: var webParams = ''section=blog&id=45''.toQueryParams(); $H(webParams).each(/* ... */); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---