简体   繁体   中英

JS alert is not functioning in ColdFusion

I am trying to figure out why this JS alert is not working. The function of the alert is to validate if the data been selected before.

 <script type="text/javascript">
        alert("This location been chosen.\n Please choose another location.");
        history.back();
 </script>

However when I try to check the error, I'm turning on the ColdFusion debug, the js alert runs smoothly.

Unless window.alert has been redefined it will work as long as you pass it a value that is a string (or converts to a string).

I'd suspect that either the script tag is not being output in your generated source or that there is a JavaScript error elsewhere that is causing all code after it to not parse.

很可能是您生成的JavaScript无效-在浏览器中检查JavaScript警告。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM