I have Beautytips installed and set to load on every page. One one particular page, I am using some jQuery to load some content from another page, and inject some of the content into a div (the content that is being loaded is a Vimeo video).

When I click on the link to load the AJAX content, IE gives this error:

'jQuery.bt.options' is null or not an object

My jquery code looks like this:

Drupal.behaviors.twestivalVideoLoad = function(context) {

  // attach ajax functionality to the video thumbnails
  var hash = window.location.hash.substr(1);
  var href = $('#project-menu a').each(function(){
      var href = $(this).attr('href');
      if(hash==href.substr(0,href.length)){
          var toLoad = hash+'?ajax=1';
          $('.pane-twestival-videos-panel-pane-1 .view-id-twestival_videos.view-display-id-panel_pane_2 .field-content').load(toLoad)
      } 
  });

  // remove the default click handlers from emfield.
  $('.pane-twestival-videos-panel-pane-1 .views-field-field-external-video-embed a').unbind('click');
   
  // Add our own click handler
  $('.pane-twestival-videos-panel-pane-1 .views-field-field-external-video-embed a').click(function(e){
    e.preventDefault(); 
    
    var area = $('.view-id-twestival_videos.view-display-id-panel_pane_2 .field-content');

    var toLoad = $(this).attr('href') + '?ajax=1';  
    area.load(toLoad,'',showNewContent);
    return;
    
    function showNewContent() {
	    area.show('slide', {direction: 'left'}, 400);
	    Drupal.attachBehaviors(area);
    }

    // prevent the default click handler.
    return false;
  });
};

In the top of the Beautytips JavaScript behaviour, you attempt to assign something to jQuery.bt.options. Now, for whatever reason, this does not exist when Drupal.attachBehaviors(area) is run, and hence the error.

Any ideas? Perhaps it's todo with the way that you are adding the beautytips js to the page?

Comments

kleinmp’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #1064358: Dialog Box, Chaos Tools and javascript issues with BeautyTips. This just needs to be ported to the drupal 6 version.