我不拥有的网站使用<script>
标记添加了以下代码。我可以使用Firefox的ScratchPad或Greasemonkey更改url
内的a.ajax
变量吗?
若然,怎么样?
如果没有,为什么?是否至少可以修改c
变量,如果是,如何修改?
validateUsername: function ()
{
clearTimeout(b.signUp.usernameValidationTimer);
b.signUp.usernameValidationTimer = null;
var c = a("#register-username").val();
if(3 > c.length)
b.signUp.hideValidationError("#register-username"), a("#register-username").removeClass("validate_ok");
else
{
if(b.signUp.usernameValidation == c) return !1;
b.signUp.hideValidationError("#register-username");
b.signUp.usernameValidation = c;
a("#register-username").addClass("ajax-load");
a.ajax(
{
type: "POST",
dataType: "json",
url: "/" + b.signUp.getMarket() + "/xhr/json/validate-email.php",
xhrFields:{ withCredentials: !0 },
data:{ username: c },
success: function (c)
{
a("#register-username").removeClass("ajax-load");
"object" == typeof c ? "1" == c.status ? b.signUp.hideValidationError("#register-username", !0) :b.signUp.showValidationError("#register-username", c.message) :
b.signUp.showValidationError("#register-username")
}
})
}
}
答案 0 :(得分:1)
您可以使用Firefox相对简单地修改相关代码中的c
变量(也不需要插件)。
我创建了一个简单的测试页面,显示加载时的日期/时间:
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
var day = now.getDate();
var hour = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var ampm = (hour < 12 ? "am" : "pm");
if (hour == 0) {
hour = 24;
}
document.write(
year.toString() + '-' +
(month < 10 ? '0' + month.toString() : month.toString()) + '-' +
(day < 10 ? '0' + day.toString() : day.toString()) + ' ' +
(hour < 10 ? '0' + hour.toString() : hour > 12 ? (hour - 12).toString() : hour.toString()) + ':' +
(minutes < 10 ? '0' + minutes.toString() : minutes.toString()) + ':' +
(seconds < 10 ? '0' + seconds.toString() : seconds.toString()) + ' ' +
ampm
);
<强>结果:强>