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.
我的网站中有一个画廊部分,我想上传一张注入 JavaScript 的图片。
当它被模式框打开和放大时,我需要运行 JavaScript。我怎样才能做到这一点?
没有。注射是不可能的。要在加载图像时执行 JavaScript,您可以执行
i = new Image(); i.onload = function() {} i.src = '...';