[英]How can I edit JS from browser?
Suppose I get, on a page, this simple html/script : 假设我在页面上得到了这个简单的html / script:
<a id="hey" href="#">try</a>
var myvar=false;
$('#hey').click(function () {
if(myvar)
{
alert("Well! You change it!");
}
});
clicking on the link, I won't never get the alert show up! 点击链接,我将永远不会显示警报! So, how can I edit JS (changing
myvar=true;
) on browser? 那么,如何在浏览器上编辑JS(更改
myvar=true;
)? I use Firebug... I need these details to test a security-side of my own application. 我使用Firebug ...我需要这些详细信息来测试自己应用程序的安全性。
first warp with : 第一次扭曲:
<script type="text/javascript">
var myvar=false;
$('#hey').click(function () {
if(myvar==true)
{
alert("Well! You change it!");
}
});
</script>
I readlly think you have a problem somewhere else. 我很乐意认为您在其他地方遇到了问题。 ...
...
take this code and save it in a file. 获取此代码并将其保存在文件中。
this is what youll get 这就是你会得到的
myvar is false ( beginning) myvar为假(开头)
now set it to true : 现在将其设置为true:
and click and see : 然后单击以查看:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.