因此,我正在使用 JSF 2.0,并且创建了一个如下所示的 javascript:
<script type="text/javascript">
function generate(){
if(!licenseServerInfo){
NI.pnx.messaging.popMessage(NI.pnx.messaging.messageTypes.warning,['<strong>Your changes to License Server Name and Computer ID have not been saved.</strong><a href="" class="right"><strong>Undo Change</strong></a>'],NI.pnx.messaging.messageTimeoutSpeeds.never);
}else{
generateLicenseFile();
document.getElementById('upperButtons:generateCall').click();
}
}
</script>
但它是这样渲染的:
<script type="text/javascript"><!--
function generate(){
if(!licenseServerInfo){
NI.pnx.messaging.popMessage(NI.pnx.messaging.messageTypes.warning,['<strong>Your changes to License Server Name and Computer ID have not been saved.
//--></strong><a class="right"><strong>Undo Change<!--
function generate(){
if(!licenseServerInfo){
NI.pnx.messaging.popMessage(NI.pnx.messaging.messageTypes.warning,['<strong>Your changes to License Server Name and Computer ID have not been saved.
//--></strong><!--
function generate(){
if(!licenseServerInfo){
NI.pnx.messaging.popMessage(NI.pnx.messaging.messageTypes.warning,['<strong>Your changes to License Server Name and Computer ID have not been saved.
//--></a>'],NI.pnx.messaging.messageTimeoutSpeeds.never);
}else{
generateLicenseFile();
document.getElementById('upperButtons:generateCall').click();
}
}
<!--
function generate(){
if(!licenseServerInfo){
NI.pnx.messaging.popMessage(NI.pnx.messaging.messageTypes.warning,['<strong>Your changes to License Server Name and Computer ID have not been saved.
//--></script>
使用 chrome 的控制台,如果我调用每个包含的函数,它们都可以正常工作。但是如果我尝试调用 generate(),它会说它不存在。
有任何想法吗?