Hi, I have the simplest of problem but I can''t seem to find a simple solution to it and this is driving me nuts. I submit a form via an Ajax.Updater call . The value returned is a status string with some HTML tags. It all seem to work except for the fact that when the returned string is displayed, starting and ending double quotes are displayed as well. (BonEcho/Konqueror/IE) Why are the quote displayed and can I prevent this without processing the returned string? On the server side I use Django.simplejson TIA François --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey François W/o any code we won''t be able to help you... -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bonjour Christophe, Well... that is the thing... The code is SOOOO simple (too? and in any case a lot of magic in the background) My form is ========%<=========%<=========== <form action="" id="NRYForm" method="POST" onsubmit= "selt=$ (''formsubmit''); selt.hide(); new Ajax.Updater(''status'',''/ajaxrpc/ directPrint/'', {asynchronous:true, parameters:Form.serialize(this),onComplete:function() {selt.show();}});xx= document.getElementById( ''id_Batch'' ) ; xx.value=''''; return false";"/> <table><tr><th><label for="id_Batch">Batch Number:</label></ th><td><input type="text" name="Batch" id="id_Batch" /><br />Scan or type in the batch umber<input type="hidden" name="value" value="BatchBundleBC" id="id_value" /></td></tr></table> <input type="submit" id="formsubmit" value="Print"> </form> ========%<=========%<=========== On the server I do ========%<=========%<=========== myencoder=simplejson.JSONEncoder(ensure_ascii=False,sort_keys=True) return HttpResponse(myencoder.encode("<p>This is my status</p>")) ========%<=========%<=========== The message gets displayed where I expect it.... but with quotes. I use the same system to cascade dropdown select and it works great. Thanks, François <div id="status"></div> On May 23, 1:31 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey François > > W/o any code we won''t be able to help you... > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey, Why ON EARTH do you JSON-encode an HTML fragment instead of just sending it back normally? JSON is entirely off-base here, just send your HTTPResponse with the HTML in it! -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Silly Me, I started with using JSON to send dictionary/hashes... from there I went on to send.. strings duh... I knew it was something dumb..... but these are sometimes the hardest to find :) Thanks, François On May 23, 1:57 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey, > > Why ON EARTH do you JSON-encode an HTML fragment instead of just sending > it back normally? JSON is entirely off-base here, just send your > HTTPResponse with the HTML in it! > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Silly Me, I started with using JSON to send dictionary/hashes... from there I went on to send.. strings duh... I knew it was something dumb..... but these are sometimes the hardest to find :) Thanks, François On May 23, 1:57 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey, > > Why ON EARTH do you JSON-encode an HTML fragment instead of just sending > it back normally? JSON is entirely off-base here, just send your > HTTPResponse with the HTML in it! > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---