0

我在 IE8 上遇到了 undefined 的错误,而不是函数对象。
但在 IE10 和其他浏览器上它工作正常。下面是Javascript代码

 function SendInterestLoudAndClear1(e, link, username, profileLink, listingStatus) {
        // disable further clicks
        if($(e) != null){
            $(e).set("onclick", "SendInterestLoudAndClear(null)");

      if (link.indexOf("sendinterest") > -1) {
          // Only need the listingStatus
          SetListingDetails('', listingStatus);

          if ('{{listingtype}}' == 'look') {
             DoTracking( 'LoggedInSummaryLook','click', 'SendInterestButton', listingStatus);
          }
          else {
               DoTracking( 'LoggedInSummaryHave', 'click','SendInterestButton', listingStatus);
          }
          new Request({
              url: link,
              onSuccess: function () {
                {%if useLoudandClear %}


                    var lightboxId = 'send_interest-basic';
                    if ({{subsStatus}} == false || listingStatus == '2')
                    {
                        lightboxId = 'send_interest-premium';
                    }
                     SetLightBoxForSendInterest(lightboxId, username, profileLink);
                     showLightBox(lightboxId, 659);



                      if (e.getAttribute('title') == null || e.getAttribute('title') == "") {
                          // Remove this node but get a reference to its parent
                          var parent = $(e).getParent(); 
                          // Destroy the anchor link and child - free memory.
                          $(e).destroy();

                          // Construct new html to be inserted into parent node
                          var img1 = new Element("img", { src: "{{StaticURL}}/images/ok.png", alt: "{{caption3108}}" });
                          var span2 = new Element("span", { class: "erm-grey-fav", title: "{{caption3108}}", text: "{{caption3108}}", onclick: "SendInterestLoudAndClear(this)" });
                          var interestSentElements = new Elements([img1, span2]);

                          // Use adopt instead to add to dom new divs
                          $(parent).adopt(interestSentElements);
                      }
                  {%else%}
                        //showLightBox('interestsentbox', 300);
                      if (e.getAttribute('title') == null || e.getAttribute('title') == "") {
                          e.removeAttribute('onclick');
                          e.removeAttribute('style');
                          // e.innerHTML='{{caption1393}}';
                          $(e).set("html", '{{caption1393}}');
                          var id1 = e.get('id');
                          var img1 = id1 + "_sendinterest";
                          $(img1).src = "{{StaticURL}}/images/ok.png";
                          $(img1).style.display = "inline";
                          e.setAttribute('title', "{{caption1269}}");
                          e.set('class', 'erm-grey-fav');
                      }
              {%endif%}
              },
              onFailure: function () {
                  alert("failed");
              }
          }).send();
      }
      }

  }
4

0 回答 0