RamiD has asked for the wisdom of the Perl Monks concerning the following question:
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
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.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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl pass hashref param to server into json stream
by Anonymous Monk on Aug 03, 2016 at 21:26 UTC | |
by RamiD (Acolyte) on Aug 04, 2016 at 16:49 UTC | |
by Anonymous Monk on Aug 05, 2016 at 09:16 UTC |