2016-08-15, 15:15
HI,
I need some help please.
I have create a script add-on that I want to execute from javascript.
If I sent the command using curl, it works perfectly, but I don't know how to send it from javascript using jQuery.
This is the curl statement that works:
This is my javascript code:
I get the following error:
Obviously, I don't understand something
Can anybody please help?
I need some help please.
I have create a script add-on that I want to execute from javascript.
If I sent the command using curl, it works perfectly, but I don't know how to send it from javascript using jQuery.
This is the curl statement that works:
Code:
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.tv.msg"} }' http://10.4.1.73:80/jsonrpc
This is my javascript code:
Code:
$.ajax({
type: "POST",
contentType: "application/json",
data: {
"jsonrpc": "2.0",
"method": "Addons.ExecuteAddon",
"params": {"addonid": "script.tv.msg"}
},
dataType: "json",
//
success: alert("Success"),
error: alert("Failure")
})
I get the following error:
Code:
"NetworkError: 404 Not Found - http://10.4.1.73/addons/plugin.webinterface.tvmsg/jsonrpc"
Obviously, I don't understand something
Can anybody please help?