简体   繁体   English

将在浏览器中禁用javascript会影响ajax调用和js函数

[英]will disabling javascript in browser affect ajax calls and js functions

i have a doubt 我有个疑问

i guess there are some options like disabling javascript in the browser. 我猜有一些选项,例如在浏览器中禁用javascript。

if so then ajax and javascript functions wont work isnt it? 如果是这样,那么ajax和javascript函数将无法正常工作吗? if so is there any solution? 如果可以的话,有什么解决办法吗? .

YES disabling JS will disable JS... so no AJAX as it's done with JS... 是的,禁用JS会禁用JS ...因此不会像使用JS一样完成AJAX ...

only solutions are server-sided fallbacks. 只有解决方案是服务器端的后备。

The solution is what is called progressive enhancement : 解决方案是所谓的渐进增强

  • Make your site work without Javascript, then 让您的网站在没有Javascript的情况下工作,然后
  • Add the fancy ajaxy layer on top. 在顶部添加花式ajaxy层。

That way, users without Javascript will still get a functional site. 这样,没有Javascript的用户仍将获得功能站点。

AJAX = Asynchronous JavaScript and XML, so of course ajax and javascript functions won't work. AJAX =异步JavaScript和XML,因此ajax和javascript函数当然不起作用。 Javascript has to be enabled. 必须启用Javascript。

Ajax and jQuery are Javascript, so yes, they're disabled also.although you didn't ask for jQuery but still. Ajax和jQuery是Javascript,所以是的,它们也被禁用。尽管您并未要求使用jQuery,但仍然需要。

Something to learn about Graceful Degradation 关于优雅降级的一些知识

Simple answer: no, they won't work. 简单的答案:不,它们不会起作用。

And there is no particular solution, only thing you can do is use <noscript> tag and notify the user about his browser settings. 并没有特定的解决方案,只能使用<noscript>标记并将用户的浏览器设置通知用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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