Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE conflict with jquery? #49

Open
mstueve opened this issue Aug 4, 2009 · 10 comments
Open

IE conflict with jquery? #49

mstueve opened this issue Aug 4, 2009 · 10 comments

Comments

@mstueve
Copy link

mstueve commented Aug 4, 2009

I'm experiencing the following issue: I do a Cufon.replace('h1'); and everything works fine. However, on one page I have a radio button which when clicked does a few things. Once I added Cufon, I started to get a series of javascript errors on this radio button click. I did a little debugging and tracked it down to the following code, which gets triggered on click:

function setDefaultSeasonSelected() {
var radioBtns = $(".seasonListing :radio");
alert("setDefaultSeasonSelected");
if ( radioBtns.filter(":checked").length == 0 ){
radioBtns.filter(":enabled").eq(0).attr("checked", "checked");
}
alert("setDefaultSeasonSelected2");
}

I put those alerts in there for testing, and what I see is this -- I get a javascript error, "Failed," then the first alert, then "undefined is null or not an object," then my script terminates, never popping the second alert.

Note that the radio buttons the above code is looking for are added dynamically to the DOM prior to the above code being executed.

If I remove Cufon from my page, everything works fine. When Cufon is added, the above code breaks. It looks like jquery can no longer find the $(".seasonListing :radio") when Cufon is included. This code works fine in Firefox 3 but fails in IE6 and 7. Any ideas?

@mstueve
Copy link
Author

mstueve commented Aug 4, 2009

Update -- changing

var radioBtns = $(".seasonListing :radio");

to

var radioBtns = $(".seasonListing input:radio");

seems to have fixed the problem.

@sorccu
Copy link
Owner

sorccu commented Aug 5, 2009

Hi,

This may be related to issue #1, but it should have been fixed a long time ago. Are you sure that you're using at least a fairly recent version of Cufón? Newer versions are fully backwards compatible, so you should be able to upgrade to 1.02 without any issues.

By the way, did you use gradients or text shadows?

Simo

@ovoice
Copy link

ovoice commented Aug 5, 2009

I ran into a similar issue using a very recent version of Cufon. I found this with IE6 and just wound up disabling Cufon in IE6. I didn't wind up tracing the issue down in the JS, so I'm not sure if it's the exact same issue, but I did have conflicts.

@sorccu
Copy link
Owner

sorccu commented Aug 5, 2009

Real IE6 or MultipleIE? Did you use text shadows or gradients?

@ovoice
Copy link

ovoice commented Aug 5, 2009

Real IE6. No shadows or gradients.

@ovoice
Copy link

ovoice commented Aug 5, 2009

I can't do it now, but I can try to get more information for you in a few days time.

@mstueve
Copy link
Author

mstueve commented Aug 5, 2009

Sorccu, I'm not sure which version I have but I grabbed it off of the Cufon website 2 or 3 weeks ago, so it is very recent. In my debugging, I thought perhaps it was something to do with the YUI compressed version (perhaps there were function name conflicts with other YUI compressed scripts I had), so I tried the uncompressed version here on GitHub just yesterday and still saw the problem. I see it in IE6 (MultipleIEs) and IE7.

@mstueve
Copy link
Author

mstueve commented Aug 5, 2009

Oh, and no, I didn't use any shadows or gradients

@sorccu
Copy link
Owner

sorccu commented Aug 5, 2009

A test case would really help.. do you think you could PM me the url?

@mstueve
Copy link
Author

mstueve commented Aug 5, 2009

Unfortunately it's not public yet, so there isn't a URL that you can see. I could possibly email you the rendered HTML and JS, but the issue occurs on an ajax callback so I'm not sure that would help either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants