You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/06/05 11:43:28 UTC

T5: using jQuery in 5.0.18

Hi,

following error always show up in the error console of Firefox:

Error: element.attachEvent is not a function
Source File: http://127.0.0.1:8080/assets/5.0.18/scriptaculous/prototype.js
Line: 4016
line: 4071

if I uncomment the following line, error goes away, any idea why?

java code:

//@IncludeJavaScriptLibrary({"context:/js/jquery-1.3.2.min.js"})

public class Test2 {
}

template:

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
< head>
    < title>Start Page</title>
< /head>
< body>
< h1>test</h1>
< /body>
< /html>


-- 
View this message in context: http://www.nabble.com/T5%3A-using-jQuery-in-5.0.18-tp23885303p23885303.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: T5: using jQuery in 5.0.18

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Thiago,

That works with my simple test page, Thanks. now will proceed to the
complicated pages.

Angelo


Thiago H. de Paula Figueiredo wrote:
> 
> On Fri, Jun 5, 2009 at 10:01 AM, Angelo Chen<an...@yahoo.com.hk>
> wrote:
> 
>> Hi,
> 
> Hi!
> 
>> Andy's solution works, however if modifying jquery works, it will be
>> transparent, now at where should I insert the jQuery.noConflict()?
>> jQuery's
>> code really too difficult for me to understand. the last two lines from
>> uncompressed file are:
>>
>> });
>> })();
> 
> Put jQuery.noConflict() after all the code there (in the end of the file).
> 
> -- 
> Thiago
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/T5%3A-using-jQuery-in-5.0.18-tp23885303p23888068.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: T5: using jQuery in 5.0.18

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, Jun 5, 2009 at 10:01 AM, Angelo Chen<an...@yahoo.com.hk> wrote:

> Hi,

Hi!

> Andy's solution works, however if modifying jquery works, it will be
> transparent, now at where should I insert the jQuery.noConflict()? jQuery's
> code really too difficult for me to understand. the last two lines from
> uncompressed file are:
>
> });
> })();

Put jQuery.noConflict() after all the code there (in the end of the file).

-- 
Thiago

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


Re: T5: using jQuery in 5.0.18

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,
Andy's solution works, however if modifying jquery works, it will be
transparent, now at where should I insert the jQuery.noConflict()? jQuery's
code really too difficult for me to understand. the last two lines from
uncompressed file are:

});
})();




Thiago H. de Paula Figueiredo wrote:
> 
> On Fri, Jun 5, 2009 at 7:52 AM, Andy Pahne<an...@gmail.com> wrote:
> 
>> I had the same problem.
>> Unfortunatly calling
>>  jQuery.noConflict() did not help, either.
>> Don't know what the exact problem was.
> 
> I guess that's because jQuery.noConflict() was invoked after it
> should. My solution was to edit the jQuery file to include
> jQuery.noConflict() in its the end. I also had to edit the jQuery
> plugin I was using (Color Picker) to replace calls to $() to
> $jQuery().
> 
> -- 
> Thiago
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/T5%3A-using-jQuery-in-5.0.18-tp23885303p23887748.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: T5: using jQuery in 5.0.18

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, Jun 5, 2009 at 7:52 AM, Andy Pahne<an...@gmail.com> wrote:

> I had the same problem.
> Unfortunatly calling
>  jQuery.noConflict() did not help, either.
> Don't know what the exact problem was.

I guess that's because jQuery.noConflict() was invoked after it
should. My solution was to edit the jQuery file to include
jQuery.noConflict() in its the end. I also had to edit the jQuery
plugin I was using (Color Picker) to replace calls to $() to
$jQuery().

-- 
Thiago

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


Re: T5: using jQuery in 5.0.18

Posted by Andy Pahne <an...@gmail.com>.
I had the same problem.

Unfortunatly calling
  jQuery.noConflict() did not help, either.

Don't know what the exact problem was.

My workaround: I did not include jQuery via @IncludeJavaScriptLibrary, 
but instead I loaded it with a plain script tag in my layout component 
and then called jQuery.noConflict().
That helped, the error message went away and jQuery worked ini my pages


Andy



Angelo Chen schrieb:
> Hi,
>
> following error always show up in the error console of Firefox:
>
> Error: element.attachEvent is not a function
> Source File: http://127.0.0.1:8080/assets/5.0.18/scriptaculous/prototype.js
> Line: 4016
> line: 4071
>
> if I uncomment the following line, error goes away, any idea why?
>
> java code:
>
> //@IncludeJavaScriptLibrary({"context:/js/jquery-1.3.2.min.js"})
>
> public class Test2 {
> }
>
> template:
>
> < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> < html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> < head>
>     < title>Start Page</title>
> < /head>
> < body>
> < h1>test</h1>
> < /body>
> < /html>
>
>
>   


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


Re: T5: using jQuery in 5.0.18

Posted by Onno Scheffers <on...@piraya.nl>.
Are you using the jQuery no-conflict mode?

jQuery.noConflict();

Otherwise Prototype and jQuery will conflict.


regards,

Onno Scheffers



On Fri, Jun 5, 2009 at 11:43 AM, Angelo Chen <an...@yahoo.com.hk>wrote:

>
> Hi,
>
> following error always show up in the error console of Firefox:
>
> Error: element.attachEvent is not a function
> Source File:
> http://127.0.0.1:8080/assets/5.0.18/scriptaculous/prototype.js
> Line: 4016
> line: 4071
>
> if I uncomment the following line, error goes away, any idea why?
>
> java code:
>
> //@IncludeJavaScriptLibrary({"context:/js/jquery-1.3.2.min.js"})
>
> public class Test2 {
> }
>
> template:
>
> < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> < html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> < head>
>    < title>Start Page</title>
> < /head>
> < body>
> < h1>test</h1>
> < /body>
> < /html>
>
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-using-jQuery-in-5.0.18-tp23885303p23885303.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
>
>