安全问题 [英] js security question

查看:101
本文介绍了安全问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在生成一个带有php的字符串,用于html按钮的onclick事件,输出如下:

I'm generating a string with php for onclick event of an html button with an output like this:

<button class="ChooseButton" id="168" onclick="LoadTheme(['#993300', '#99CC99', '#003366', '#993300', '#99CC99'])">Choose</button>





单击此按钮时,相应的功能变为arr ay of colors并将它们分配给一些html元素。

这是一个带有这些参数的安全代码吗?



When this button is clicked, corresponding function gets an array of colors and assigns them to some html elements.
Is this a secure code with those parameters?

推荐答案

按设计,JavaScript是像地狱一样安全,除非有人使用像嵌入式ActiveX组件那样脏的东西,否则会破坏它。但是,如果有人改变某些页面上的颜色,即使它可能使其完全不可读(红色背景上的红色字体),如何关心?它可能会破坏什么?没什么,真的。



-SA
By design, JavaScript is secure like hell, unless someone use such a dirty thing as embedded ActiveX components which spoil it all. However, how care if someone changes the colors on some page, even if it could make it completely unreadable (red font on red background)? What can it possibly destroy? Nothing, really.

—SA


这篇关于安全问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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