Here is what I tried a lot further ..
<html>
<head>
<title>bugstats.com</title>
</head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://jquery-json.googlecode.com/files/jquery.json- 1.3.min.js"></script>
<script type="text/javascript" >
function hello(){
var myObject = {"method":"User.login",
"params":[ { "login" :"user",
"password" : "pass123" ,
"remember" : "True"} ] };
var enc = $.toJSON(myObject);
$.ajax({"contentType":"application/json",
"data": enc,
"crossDomain":"true",
"dataType": "json",
"url": "https://bugzilla.company.com/bugzilla/jsonrpc.cgi",
"type": "POST",
success: function(){
alert("Hallelujah");
console.log(arguments);
},
error: function () {
alert("Failed")
}
});
}
function parseResponse(obj){
alert("Success")
console.log(obj)
}
</script>
<body>
<h1>bugzilla.com</h1>
<input type="button" onclick="hello()" value="Click">
</body>
Reading this JSONPRC is not going far.
When I press the button - I make a call to enter / do something in this regard - I get the following error -
OPTIONS https://bugzilla.company.com/bugzilla/jsonrpc.cgi 403 (Forbidden) jquery.min.js:19
XMLHttpRequest cannot load https://bugzilla.company.com/bugzilla/jsonrpc.cgi. Origin http://172.16.229.137 is not allowed by Access-Control-Allow-Origin.
In my opinion, "Access-Control-Allow-Origin" is called due to "the same problem with the original policy" and therefore I have to use "jsonp". But Jsonp injection - ie, script can only be executed with a GET request. But if I try the same JS script with a GET request, I get the following:
code: 32610
message: "For security reasons, you must use HTTP POST to call the 'User.login' method."
, / -, , , - , - .. , - . 8-10 ..:(
FYI:
,
Ajax Call
Loggin In
BugzillaApc
Google -