admin管理员组文章数量:1405730
I am attaching client script to Nestuite iframe suitelet to hide div element.
Here's the strange part:
1.If I inspect the element in the browser's developer tools and then execute document.getElementById('abc')
in the console, it returns null.
2. But, if I copy the JSON path of the element in the developer tools and then execute document.getElementById('abc')
in the console, it correctly returns the element.
Below in Netsuite client script:
//Client Script
function pageInit(scriptContext) {
document.getElementById("uif37");
}
//i_frame suitelet
if (context.request.method === 'GET') {
var form = serverWidget.createForm({title: 'Monitoring System', hideNavBar: true});
// Construct URLs for child Suitelets
var fisrtiframeUrl = buildIframeUrl('scriptid', 'deployid');
var secondiframeUrl = buildIframeUrl('scriptid', 'deployid);
var fisrtiFrameHtml = "<iframe src='" + fisrtiframeUrl + "' id='view' width='50%' height='700px' scrolling='auto' name='firstframeView' marginheight='0' marginwidth='0' frameborder='0'></iframe>";
var secondiFrameHtml = "<iframe src='" + secondiframeUrl + "' id='view' width='50%' height='700px' scrolling='auto' name='secondframeView' marginheight='0' marginwidth='0' frameborder='0'></iframe>";
var combinedHtml = fisrtiFrameHtml + secondiFrameHtml;
var htmlField = form.addField({
id: 'custpage_my_iframe',
type: serverWidget.FieldType.INLINEHTML,
label: 'Performance iFrame'
});
htmlField.defaultValue = combinedHtml;
form.clientScriptModulePath = 'SuiteScripts/cs_hide_div.js';
form.addResetButton({label: 'Cancel'});
context.response.writePage(form);
}
}
本文标签:
版权声明:本文标题:javascript - document.getElementById returns null in Netsuite client script and in developers tool - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744930294a2632857.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论