10513 questions

12518 answers


22043 members

0 votes
2,376 views 4 comments
I try to make a html page where I want to show some detail of my RUT955 (GPS coordinates, I/O ...).

I want to do this with the JSON RPC procedure. Like explain in the wiki page I try first this with the add-on of firefox and everything works nice.

Now i'm trying to implement this in a html page (php, javascript or ...) but this doesn't work. Can anyone help me? I show a part of my javascript, maybe I make a small mistake !?

Thanks in advance !




   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>




            url: '',

            data: JSON.stringify ({"jsonrpc":"2.0", "id":1, "method":"call", "params":["00000000000000000000000000000000", "session", "login",{"username":"root", "password":"password"}]} ),



            success:  function (data)       

            { alert("The result is : " + data.result);},

            error: function (err)  { alert ("Error");}






  <h1> JSON RPC 2.0 demo </h1>


Can someone give me more explanation.....

Hi Jeroeng

I have been trying exactly the same with an Ajax call. Did you have success?  Would love to hear your HTTP AJAX POST solution. !

BTW, I am also trying to do this from C# controller but is only halfway. Got the "session-Id" successfully, but now needs to POST the session ID plus command.. Not successful with C# (yet) as I am getting a return {"jsonrpc":"2.0","id":1,"result":[0,{"code":0}]}.... because of unable to send ["-x"].

Any suggestions in the forum ?

Many thanks


1 Answer

0 votes
I would redesign how you want to do this, you are giving out your API credentials in the header of the html file. Anything that can be hacked this easy will be hacked.
understood, can you give me an example?