未参考的参考错误:试验版没有定义 [英] Uncaught referenceerror: trialscript is not defined

查看:73
本文介绍了未参考的参考错误:试验版没有定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码中的脚本给出错误:

The script in the code below is giving error:

Uncaught ReferenceError: TrialScript is not defined










<html>
<head>
<Title>Demo Script</Title>

 <script type="text/javascript">
                function TrialScript()
                {
				    if (confirm('Are you sure you want to proceed?') == true) 
                    { 
						document.getElementById('Hidden1').value = 'yes'; 
                    } 
                    else   
                    {  
                        document.getElementById('Hidden1)'.value = 'no';
                    }
                }
                
            </script>


</head>

<body onload="TrialScript();">

<input id="Hidden1" type="hidden" />

</body>

</html>





我的尝试:



我已经完成了各种形式的搜索和调试,但无法得到它。



What I have tried:

I have done all form of searching and debugging, but couldn't get it.

推荐答案

document.getElementById('Hidden1)'.value = 'no';

Hidden1的收盘价不在括号内。

Your closing quote on Hidden1 is outside the bracket.


这篇关于未参考的参考错误:试验版没有定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆