我得到了这个脚本:
<script>
    $(document).ready(function () {
        $('a[@href^= ""] img').parent().click(function () {
            var linkz = $(this).attr("href");
            if(linkz.toLowerCase().indexOf("http: //www.website.com") >= 0) {
                window.open($(this).attr("href"));
                return false;
            } else {
                window.open("http://www.website.com/p/img.html?img=" + $(this).attr("href "));
                return false;
            }
        });
    });
</script>
在新页面中打开所有图像,并在新链接中传递图像 url。但我得到
TypeError: $ is not a function.
我试图添加 jQuery(document) 而不是 $(document) 但后来我得到了
$('a[@href^=""] img')类型错误:$ 不是函数
这里。