禁用Java脚本时替代警报框 [英] Alternative to alert box when Java Script is disabled

查看:64
本文介绍了禁用Java脚本时替代警报框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用客户端和服务器端验证。我只是想知道如果客户端已禁用,警报框是否有任何替代方法,以便我可以从服务器端显示验证消息

解决方案

不太确定如何AJAX 和Javascript-Disabled可以在这个上下文中一起使用!!



如果因为javascript被禁用而无法显示警告框,那么你猜怎么着?你确定无法进行ajax通话!!



你采取相反的方法怎么样?

(总是)生成一条消息,指出没有启用javascript并且该功能已减少。然后,在页面加载后,使用javascript删除这些消息并附加相关的事件处理程序..



对我来说似乎是明确而明显的方法。 ¯\_(ツ)_ /¯

I am using both client and Server side validation in my application. I just wanted to know if there is any alternative to Alert box if Client has disabled so that I can display validation message from server side

解决方案

Not quite sure how "AJAX" and "Javascript-Disabled" can go together in a single sentence in this context!!

If you can't show an alert box because javascript is disabled, then guess what? You sure as hell aint going to be able to do an ajax call!!

How about you take the opposite approach?
(always)Generate a message that says there's no javascript enabled and that functionality is reduced. Then, after the page has loaded, use javascript to remove these messages and to attach the relevant event handlers..

Seems like the clear and obvious approach to me. ¯\_(ツ)_/¯


这篇关于禁用Java脚本时替代警报框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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