HI , I have a problem working with perl dancer passing hashref param to server into json stream like oboe.js (json stream) Here what I did in server and client

get '/test' => sub { my $jsonobj; $jsonobj='[{"name":"test","problem":"pass to oboe stream in the se +rver "}]'; debug $jsonobj; template 'test' => {passtoserver=>$jsonobj}; }; in the server side <!DOCTYPE html> <html> <head> <script src='/javascripts/3party/oboe-browser.min.js' type +="text/javascript"></script> </head> <body> <div style = "padding: 100px 100px 10px;"> <script> oboe('<%passtoserver%>' ).done(function( fullJson ){ alert(fullJson) }); </script> </div> </body> </html>
in the example I had an error in the server side, oboe-browser.min.js:1 GET http://localhost:3000/%7B%22name%22:%22test%22,%22problem%22:%22pass%20this%20to%20oboe.js%20in%20teh%20server%20side%20%22%7D 404 (Not Found) what I did wrong !! thanks Rami D.

In reply to perl pass hashref param to server into json stream by RamiD

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.