簡體   English   中英

jQuery代碼的Internet Explorer錯誤幫助

[英]Internet Explorer error help on jQuery code

我有一個jQuery圖像庫腳本,該腳本在Internet Explorer以外的所有瀏覽器上均可正常運行。 我得到錯誤

對象不支持此屬性或方法。

我查了一下,看來這通常是由名稱相同的變量和代碼元素引起的。 我在代碼中看不到任何重疊。 該錯誤表明它位於以下代碼中:

// Append new picture
jQuery('<img />')
    .attr('src', p)
    .attr('id', pid)
    .css({
        position: 'absolute',
        top: 0,
        left: 0,
        opacity: 0.0
    })
    .bind('click.gallery', function (event) {
        options.onClick.apply(this, [event, pict.get()]);
    })
    .appendTo('#' + id)
    .animate({opacity: 1.0}, {
        queue: false,
        duration: duration,
        easing: 'linear'
    })
    .load(function () {
        pict.data('loaded', true);
    });

事實證明,頁面中包含一個雙重腳本。 (該網站最初不是由我設計的)這顯然是造成問題的原因。 我刪除了腳本,一切運行正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM