Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
只想在有人单击视频缩略图后调用一次登录功能。这就是我所拥有的:
if (videoCode == "BQXTCCyJsKE" && $secCode == null){ var $secCode = "1"; $(document).ready(function () { login() }); }
你会认为 $secCode 稍后会等于“1”,但不是。它再次变为 null 并再次调用登录函数,这给出了错误。我试过制作全局变量,但它不起作用。有人有想法么?
在答案框中书写以获得更好的格式,这是我所期望的:
var secCode = null; // I am global if (videoCode == "BQXTCCyJsKE" && secCode == null){ secCode = "1"; $(document).ready(login()); }