You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Inge Solvoll <in...@gmail.com> on 2009/11/26 16:42:14 UTC

jQuery.noConflict() not working

Hi!

Sorry for going a little bit OT here, but this is kinda T5-specific too.

I'm trying to use jQuery together with prototype in T5. It works nicely in
firefox, but in IE8, I get a lot of "object not supported, line 4821" and so
on. If I remove the reference to jQuery, everything works again. I did
include a call to jQuery.noConflict() a the end of the jQuery js-file.

I'm guessing that it would work including jQuery BEFORE prototype, as
prototype would overwrite everything that's been done by jQuery, and jQuery
doesn't have a problem with that, using a different alias instead. Does
anyone have nice approach for making T5 include jQjery.js before
prototype.js?

Re: jQuery.noConflict() not working

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 26 Nov 2009 13:42:14 -0200, Inge Solvoll <in...@gmail.com>  
escreveu:

> Hi!

Hello!

> I'm trying to use jQuery together with prototype in T5. It works nicely  
> in firefox, but in IE8, I get a lot of "object not supported, line 4821"  
> and so on. If I remove the reference to jQuery, everything works again.  
> I did
> include a call to jQuery.noConflict() a the end of the jQuery js-file.

I have a page that uses a jQuery color picker plugin and tested it in IE 7  
and 8 without problem. jQuery is added after Prototype. Besides  
jQuery.noConflict(), I just needed to replace the plugin's $() usages for  
$jQuery().

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jQuery.noConflict() not working

Posted by alanearl <al...@dash.com.ph>.

Try to visit these site:

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

It can help a lot.


Inge Solvoll-2 wrote:
> 
> Nice, thanks!
> 
> It actually worked putting jquery-core.js before all other scripts. It is
> strange, because I have a Struts page with a very similar setup, both
> prototype and jQuery included and prototype first, and it has no errors in
> IE8...
> 
> Thiago: I'm also using a jQuery plugin (jQuery UI datepicker). But my
> plugin
> works nicely without any $ replacements.
> 
> Thanks again for great help!
> 
> Inge
> 
> On Thu, Nov 26, 2009 at 5:07 PM, Jim O'Callaghan
> <jc...@yahoo.co.uk>wrote:
> 
>> I see there's another response already that may indicate the problem lies
>> elsewhere but just in case you do want to reorder the included files ...
>>
>> ... can you contribute and use a custom ClientInfrastructure containing a
>> list for the javascriptStack, add jQuery.js first to your list, and then
>> add
>> the existing clientInfrastructure javascriptStack?  I used a variation of
>> this solution from elsewhere on the mailing list to get around a
>> blackbird
>> issue I was having.
>>
>> ... in AppModule ...
>>   public ClientInfrastructure
>> decorateClientInfrastructure(ClientInfrastructure original) {
>>          return new MyClientInfrastructure(original);
>>  }
>>
>> ... MyClientInfrastructure.java (untested so probably some syntax errors)
>> ...
>>
>> public class MyClientInfrastructure implements ClientInfrastructure {
>>    ClientInfrastructure clientInfrastructure;
>>    List javascriptStack = new ArrayList();
>>
>>    public MyClientInfrastructure(ClientInfrastructure
>> clientInfrastructure)
>> {
>>            this.clientInfrastructure = clientInfrastructure;
>>                javascriptStack.add(asset for jQuery);
>>           
>> javascriptStack.addAll(this.clientInfrastructure.getJavascriptSt
>> ack());
>>    }
>>
>>    public List<Asset> getJavascriptStack() {
>>                return javascriptStack;
>>    }
>>
>>    public List<Asset> getStylesheetStack() {
>>            return clientInfrastructure.getStylesheetStack();
>>    }
>>
>> HTH.
>>
>> Regards,
>> Jim.
>>
>> -----Original Message-----
>> From: Inge Solvoll [mailto:inge.tapestry@gmail.com]
>> Sent: 26 November 2009 15:42
>> To: Tapestry users
>> Subject: jQuery.noConflict() not working
>>
>>
>> Hi!
>>
>> Sorry for going a little bit OT here, but this is kinda T5-specific too.
>>
>> I'm trying to use jQuery together with prototype in T5. It works nicely
>> in
>> firefox, but in IE8, I get a lot of "object not supported, line 4821" and
>> so
>> on. If I remove the reference to jQuery, everything works again. I did
>> include a call to jQuery.noConflict() a the end of the jQuery js-file.
>>
>> I'm guessing that it would work including jQuery BEFORE prototype, as
>> prototype would overwrite everything that's been done by jQuery, and
>> jQuery
>> doesn't have a problem with that, using a different alias instead. Does
>> anyone have nice approach for making T5 include jQjery.js before
>> prototype.js?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/jQuery.noConflict%28%29-not-working-tp26531246p26601658.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: jQuery.noConflict() not working

Posted by Inge Solvoll <in...@gmail.com>.
Nice, thanks!

It actually worked putting jquery-core.js before all other scripts. It is
strange, because I have a Struts page with a very similar setup, both
prototype and jQuery included and prototype first, and it has no errors in
IE8...

Thiago: I'm also using a jQuery plugin (jQuery UI datepicker). But my plugin
works nicely without any $ replacements.

Thanks again for great help!

Inge

On Thu, Nov 26, 2009 at 5:07 PM, Jim O'Callaghan <jc...@yahoo.co.uk>wrote:

> I see there's another response already that may indicate the problem lies
> elsewhere but just in case you do want to reorder the included files ...
>
> ... can you contribute and use a custom ClientInfrastructure containing a
> list for the javascriptStack, add jQuery.js first to your list, and then
> add
> the existing clientInfrastructure javascriptStack?  I used a variation of
> this solution from elsewhere on the mailing list to get around a blackbird
> issue I was having.
>
> ... in AppModule ...
>   public ClientInfrastructure
> decorateClientInfrastructure(ClientInfrastructure original) {
>          return new MyClientInfrastructure(original);
>  }
>
> ... MyClientInfrastructure.java (untested so probably some syntax errors)
> ...
>
> public class MyClientInfrastructure implements ClientInfrastructure {
>    ClientInfrastructure clientInfrastructure;
>    List javascriptStack = new ArrayList();
>
>    public MyClientInfrastructure(ClientInfrastructure clientInfrastructure)
> {
>            this.clientInfrastructure = clientInfrastructure;
>                javascriptStack.add(asset for jQuery);
>            javascriptStack.addAll(this.clientInfrastructure.getJavascriptSt
> ack());
>    }
>
>    public List<Asset> getJavascriptStack() {
>                return javascriptStack;
>    }
>
>    public List<Asset> getStylesheetStack() {
>            return clientInfrastructure.getStylesheetStack();
>    }
>
> HTH.
>
> Regards,
> Jim.
>
> -----Original Message-----
> From: Inge Solvoll [mailto:inge.tapestry@gmail.com]
> Sent: 26 November 2009 15:42
> To: Tapestry users
> Subject: jQuery.noConflict() not working
>
>
> Hi!
>
> Sorry for going a little bit OT here, but this is kinda T5-specific too.
>
> I'm trying to use jQuery together with prototype in T5. It works nicely in
> firefox, but in IE8, I get a lot of "object not supported, line 4821" and
> so
> on. If I remove the reference to jQuery, everything works again. I did
> include a call to jQuery.noConflict() a the end of the jQuery js-file.
>
> I'm guessing that it would work including jQuery BEFORE prototype, as
> prototype would overwrite everything that's been done by jQuery, and jQuery
> doesn't have a problem with that, using a different alias instead. Does
> anyone have nice approach for making T5 include jQjery.js before
> prototype.js?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

RE: jQuery.noConflict() not working

Posted by Jim O'Callaghan <jc...@yahoo.co.uk>.
I see there's another response already that may indicate the problem lies
elsewhere but just in case you do want to reorder the included files ...

... can you contribute and use a custom ClientInfrastructure containing a
list for the javascriptStack, add jQuery.js first to your list, and then add
the existing clientInfrastructure javascriptStack?  I used a variation of
this solution from elsewhere on the mailing list to get around a blackbird
issue I was having.

... in AppModule ...
   public ClientInfrastructure
decorateClientInfrastructure(ClientInfrastructure original) {
          return new MyClientInfrastructure(original);
  }

... MyClientInfrastructure.java (untested so probably some syntax errors)
...

public class MyClientInfrastructure implements ClientInfrastructure {
    ClientInfrastructure clientInfrastructure;
    List javascriptStack = new ArrayList();

    public MyClientInfrastructure(ClientInfrastructure clientInfrastructure)
{
            this.clientInfrastructure = clientInfrastructure;
		javascriptStack.add(asset for jQuery);
            javascriptStack.addAll(this.clientInfrastructure.getJavascriptSt
ack());
    }

    public List<Asset> getJavascriptStack() {
    		return javascriptStack;
    }

    public List<Asset> getStylesheetStack() {
            return clientInfrastructure.getStylesheetStack();
    }

HTH.

Regards,
Jim.

-----Original Message-----
From: Inge Solvoll [mailto:inge.tapestry@gmail.com]
Sent: 26 November 2009 15:42
To: Tapestry users
Subject: jQuery.noConflict() not working


Hi!

Sorry for going a little bit OT here, but this is kinda T5-specific too.

I'm trying to use jQuery together with prototype in T5. It works nicely in
firefox, but in IE8, I get a lot of "object not supported, line 4821" and so
on. If I remove the reference to jQuery, everything works again. I did
include a call to jQuery.noConflict() a the end of the jQuery js-file.

I'm guessing that it would work including jQuery BEFORE prototype, as
prototype would overwrite everything that's been done by jQuery, and jQuery
doesn't have a problem with that, using a different alias instead. Does
anyone have nice approach for making T5 include jQjery.js before
prototype.js?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org