我相信我正在使用 dojo < 1.7
我的 JS 模块的顶部使用了这些声明:
dojo.provide("com.kmbs.portlet.itsform.broadcastemailRequest"); dojo.require("com.kmbs.portal.core");
我一直在搜索有关如何将 html id 和 name 属性从 JSP 传递给模块的文档。JSP 上有一个表单,并且有几个输入字段可以根据用户输入动态(通过 JS)更改。
例子:
我有这个html:
<input id="${ns}verifyurlflag" type="hidden" name="verifyurlflag" value="0">
我想在模块中使用这个 JS(需要将其转换为模块格式,我知道。)
function VerifyUrl() {
var emailUrl = document.getElementById("${ns}emailUrl").value;
if(emailUrl){
// Set to True (1)
$('#${ns}verifyurlflag').val("1");
window.open( emailUrl, '_blank', 'toolbar=no,scrollbars=yes,menubar=yes,location=no,resizable=yes,height=500,width=700,top=100');
}
}
其中 ${ns} 是用于自动命名空间前缀的 JSTL。
请指教。谢谢你。
编辑:
目前在 JSP 中使用 JS 调用 VerifyUrl 是这样的:
<button class="btn" onclick="VerifyUrl()" id="${ns}verifyUrlBtn" disabled>Verify URL</button>