Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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
Javascript 如何从HTML到Suitescript获取价值?_Javascript_Html_Netsuite - Fatal编程技术网

Javascript 如何从HTML到Suitescript获取价值?

Javascript 如何从HTML到Suitescript获取价值?,javascript,html,netsuite,Javascript,Html,Netsuite,我正在SuiteScript2.0中编写一个suitelet,其中包含一个html部分。我需要从html表单中获取suitelet中变量的值 /** * @NApiVersion 2.x * @NScriptType Suitelet */ define([ 'N/http', 'N/email', 'N/record' ,'N/runtime'], function(http, email, record,runtime) { function onRe

我正在SuiteScript2.0中编写一个suitelet,其中包含一个html部分。我需要从html表单中获取suitelet中变量的值

/**
 * @NApiVersion 2.x
 * @NScriptType Suitelet
 */
define([ 'N/http', 'N/email', 'N/record' ,'N/runtime'], 

        function(http, email, record,runtime) {     

 function onRequest(context) {
    function sendGetRequest() {

         var param= http.get({
            url : ''
    });
        var html = '<html><body>something: '
                     + something
                     + '<br/>'
                     +'<form method="post">Input  <input type="text" name="something" id="something" value=""/> <input type="submit"/> </form></body></html>'; 
             log.debug({title : 'param', details : param});
      context.response.write(html);
      var something = html.getParameter('something');
      log.debug({title : 'something', details : something});

        }

    sendGetRequest();

}

return {
    onRequest: onRequest
};

});
/**
*@NApiVersion 2.x
*@NScriptType Suitelet
*/
定义(['N/http','N/email','N/record','N/runtime'],
函数(http、电子邮件、记录、运行时){
函数onRequest(上下文){
函数sendGetRequest(){
var param=http.get({
url:“”
});
var html='something:'
+某物
+“
” +"输入";; debug({title:'param',details:param}); context.response.write(html); var something=html.getParameter('something'); debug({title:'something',details:something}); } sendGetRequest(); } 返回{ onRequest:onRequest }; });
Suitelet上的所有内容都在上下文对象上,如果需要特定的HTML数据,必须使用客户端脚本将其放入其中一个表单字段中