如何防止 html/JavaScript 代码修改 [英] How to prevent html/JavaScript code modification

查看:59
本文介绍了如何防止 html/JavaScript 代码修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法防止用户修改带有 jQ​​uery 或 javascript 的 html 页面以更改其行为.

I would like to know if there is a way to prevent an html page with jQuery or javascript to be modified by the user to change its behavior.

用户可以使用 FireBug 或 Google Chrome 开发者栏等工具对其进行修改,以隐藏或显示 div、向页面元素添加事件侦听器等.

A user can modify it using tools such as FireBug or the Google Chrome developer bar to hide or show divs, add event listeners to page elements and so on.

我看到一些网页在加载页面时显示一个阻塞的 div 和一个弹出窗口来回答一些问题.如果你回答它,div隐藏,你可以正常看到页面.但是,如果您尝试使用 FireBug 隐藏阻止 div,页面会重新加载,并且如果您不回答弹出窗口中提出的问题,则无法正确查看页面.

I've seen some web pages showing a blocking div when the page is loaded and a pop-up telling to answer some question. If you answer it, the div hides and you can see the page normally. But if you try to hide the blocking div using FireBug, the page reloads and there is no way to see the page correctly if you don't ansewer the question asked in the pop-up.

我想知道如何防止用户做这样的事情.

I want to know how could I prevent user from doing such things.

非常感谢.

推荐答案

这是不可能的(这是非常好事).

It is not possible (which is a very good thing).

这篇关于如何防止 html/JavaScript 代码修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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