Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
IE8: fix for coexistence problem prototype.js (1.6.1) with jQuery (1.3.2)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Hubert + Associates GmbH & CoKG  
View profile  
 More options Nov 6, 2:37 am
From: "Hubert + Associates GmbH & CoKG" <Hub...@Hubert-Associates.EU>
Date: Thu, 5 Nov 2009 23:37:25 -0800 (PST)
Local: Fri, Nov 6 2009 2:37 am
Subject: IE8: fix for coexistence problem prototype.js (1.6.1) with jQuery (1.3.2)
Hi,

I had a "pure" prototype.js site until I was obliged to use jQuery
indirectly by a library provider (Telerik). Telerik does a good job,
but even they are no match for IE8, which is the only browser (we test
6) that had a problem with this. Our first reaction was to tell IE8 to
jump in the Pacific, but then we got real again, and devised the
following (hack) fix. Once the following is done, they work fine
together (there are posts on the web stating that it is impossible to
even use prototype.js on IE8 - humbug!).

So here it is, perhaps there is a way to publish a real fix using this
information, since I believe that it is an IE problem, not jQuery.
Also, any tips on better/other fixes or logical explanations to this
would be appreciated.

On line 2267 of jQuery 1.3.2, browser tests are done, once: a call to
div.getElementsByClassName("e")
This ends up in protype.js instanceMethods.getElementsByClassName
(line 4811).

In IE8 (only) the "$" operator is still the jQuery $ operator, not the
protytype $, even though the jQuery.noConflict(); is the first thing
called (by us and by telerik), globally, after loading jQuery and
before loading prototype.js (could be the other way around if
prototype had a .noConflict() feature). IE8 apparently (definitely)
has a different js initialization sequence than other browsers which
causes this problem, and IE8 brings an error of "object not defined"
at prototype.js line 4821 (where the $ operator is required). So, our
hack -- for lack of a better fix -- is to simply check the broswer
type and the className and return an empty array. So, at line
prototype.js 4817, we insert:

if (Prototype.Browser.IE) { if (className == 'e') return []; }

Then both jQuery and prototype.js coexist, whereby jQuery has been
assigned another $ operator via var $j = $.noConflict();

Make sense? Comments or tips? It would be nice to not have to patch
prototype.js for this... Maybe someone could fix IE8? :-)

Thanks,
R


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Nov 6, 12:31 pm
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Fri, 6 Nov 2009 17:31:43 -0000
Local: Fri, Nov 6 2009 12:31 pm
Subject: Re: [Proto-Scripty] IE8: fix for coexistence problem prototype.js (1.6.1) with jQuery (1.3.2)
I have commented on this many a time...

In order for them to co-exist properly you need to assign Jquery to a
variable

var $jq=jQuery.noConflict();

this will transpose to (most) if not all plugins --- certainly all the UI
stuff works with this method and no source changes

Alex Mcauley
http://www.thevacancymarket.com


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google