Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从OracleApex字段获取值,并在执行Javascript代码时作为参数传递_Javascript_Oracle Apex_Oracle Apex 5 - Fatal编程技术网

从OracleApex字段获取值,并在执行Javascript代码时作为参数传递

从OracleApex字段获取值,并在执行Javascript代码时作为参数传递,javascript,oracle-apex,oracle-apex-5,Javascript,Oracle Apex,Oracle Apex 5,我对JavaScript一无所知。下面的脚本用于从oracle apex页面在Jira中添加注释(通过调用API)。它的工作很好,但我不能从apex字段(P6_NEW2)中获取评论措辞(测试评论)。如果帖子失败,如何获取任何返回码 var usr=apex.item( "P6_NEW1" ).getValue (); var data = JSON.stringify({"body": "**Test comment**"}); var

我对JavaScript一无所知。下面的脚本用于从oracle apex页面在Jira中添加注释(通过调用API)。它的工作很好,但我不能从apex字段(P6_NEW2)中获取评论措辞(测试评论)。如果帖子失败,如何获取任何返回码

var usr=apex.item( "P6_NEW1" ).getValue ();
var data = JSON.stringify({"body": "**Test comment**"});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {console.log('success'); }});
xhr.open("POST", "https:xyz/rest/api/2/issue/QA123/comment");
xhr.setRequestHeader("authorization", "Basic " + btoa(usr + ":" + usr));
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);