Sign In/My Account | View Cart  
advertisement

Article:
 What's New in Prototype 1.5?
Subject: Incorrect parameter encoding?
Date: 2007-01-28 20:13:14
From: ickmonst

In the first example you give, an Ajax.Request call is given the parameter q:'ajax tutorials', which is encoded to be "q=ajax%20tutorials". Shouldn't this be encoded to be "q=ajax+tutorials"? Is this a problem with Prototype or a typo in the article, or am I completely off-base?

No Previous Message Previous Message   Next Message No Next Message


Titles Only Titles Only Newest First
  • Incorrect parameter encoding?
    2007-01-28 20:32:04 ickmonst

    Alright, I have answered my own question. It seems that the library will use %20. It seems that the spec says to use %20, and that encodeURIComponent produces a %20, though I have seen + used around town.


    Anyway. Another note. The article mentions using:


    ['page', 'sidebar', 'content'].each(Element.hide) // New way; 1.5-compatible


    The docs, however, suggest using:


    $('item1', 'item2', 'item3').invoke('hide');


    Happy coding!


Sponsored By: