You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by GEDA <ge...@romtelecom.ro> on 2007/06/11 09:10:22 UTC

JSONPlugin problem

Hi. I know this isn't strictly related to Struts, I have this problem with
JSONPlugin and maybe you guys can help me.

This is the code rom the jsp page:
<s:url id="smdURL" action="SMDAction.do" />
    <h1>Testing Remote Procedure Call from Ajax</h1>
    
    <script  type="text/javascript">
        dojo.require("dojo.rpc.*");
        var service = dojo.rpc.JsonService("${smdURL}");
        var person = {nume:"George"};
        var callback = function(persoana) {alert("Inaltimea persoanei este
acum:"+persoana.height);};
        var defered = service.setHeight(person,23);
        defered.addCallback(callback);
    </script>

And the error given by Firebug is:
this.connect is not a function
JsonService("/strutsajaxspringhibernatetest1/SMDAction.do")dojo.js (line
7410)
[Break on this error] this.connect(args);

Thanks.
-- 
View this message in context: http://www.nabble.com/JSONPlugin-problem-tf3899951.html#a11055986
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: JSONPlugin problem

Posted by Musachy Barroso <mu...@gmail.com>.
I think you forgot the "new" operator to create the service, it should be:

 var service = new dojo.rpc.JsonService("${smdURL}");

musachy

On 6/11/07, GEDA <ge...@romtelecom.ro> wrote:
>
>
> Hi. I know this isn't strictly related to Struts, I have this problem with
> JSONPlugin and maybe you guys can help me.
>
> This is the code rom the jsp page:
> <s:url id="smdURL" action="SMDAction.do" />
>     <h1>Testing Remote Procedure Call from Ajax</h1>
>
>     <script  type="text/javascript">
>         dojo.require("dojo.rpc.*");
>         var service = dojo.rpc.JsonService("${smdURL}");
>         var person = {nume:"George"};
>         var callback = function(persoana) {alert("Inaltimea persoanei este
> acum:"+persoana.height);};
>         var defered = service.setHeight(person,23);
>         defered.addCallback(callback);
>     </script>
>
> And the error given by Firebug is:
> this.connect is not a function
> JsonService("/strutsajaxspringhibernatetest1/SMDAction.do")dojo.js (line
> 7410)
> [Break on this error] this.connect(args);
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/JSONPlugin-problem-tf3899951.html#a11055986
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd