开发者

Jquery broken by GetResponse (email marketing) web form script

开发者 https://www.devze.com 2022-12-09 01:41 出处:网络
I\'m working on a site 开发者_运维技巧that relies on quite a bit of javascript. The problem is, I\'m not a javascript guru in the least. Yes, bit off more than I can chew, here.

I'm working on a site 开发者_运维技巧that relies on quite a bit of javascript. The problem is, I'm not a javascript guru in the least. Yes, bit off more than I can chew, here.

I'm using jquery for a spy effect, and use GetResponse for email signups.

If I implement my GetResponse script, it breaks the area later in the page which depends on the jquery script. Pull the GetResponse script and it works just fine.

Problem is, I need them both. ;)

The trick, I suppose, is that the GetResponse script is actually another Jquery script, so it's getting called twice...

Any help?

The site is http://djubi.com/testserver Check out (urlabove)/nogetresponsescript.php to see it work without the GetResponse script. You should be able to see all the source just fine.

Thanks everyone. jf


GetResponse includes jQuery and is overwriting your plugin ($.fn.simpleSpy) when it loads jQuery again. So what you can try to do is wrap your plugin and initialization in $(document).ready(). For example:

$(document).ready(function() {
  (function($) {
    $.fn.simpleSpy = function (limit, interval) {
      // snipping code out
    };
   })(jQuery);

  $(function() {
    $('ul.spy').simpleSpy();
  });
});

I pasted your code for simpleSpy into Firebug after the page loaded, and it seemed to work. If $(document).ready() doesn't work, you might want to try $(window).load().

0

精彩评论

暂无评论...
验证码 换一张
取 消