Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Brandon Aaron
Off Topic:

Seems like there have been several issues with the versions of jQuery
downloaded from the site lately.

--
Brandon Aaron


On 9/29/06, Mungbeans <[EMAIL PROTECTED]> wrote:
>
> Ok, downloaded the latest compressed version off the website (dated Thu, 31
> Aug 2006).
>
> This:
> .attr("onchange", "")
>
> still produces this error in Firefox
> "attr is not a function"
>
> I've tried:   .set( "onchange", "" )
> and it does work in removing the inline action.
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6575659
> Sent from the JQuery mailing list archive at Nabble.com.
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Mungbeans

Nevermind - I think my browser cache is playing tricks with me.  attr() is
now working and set() isn't.


-- 
View this message in context: 
http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6575761
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Mungbeans

Ok, downloaded the latest compressed version off the website (dated Thu, 31
Aug 2006).

This:
.attr("onchange", "")

still produces this error in Firefox 
"attr is not a function"

I've tried:   .set( "onchange", "" )
and it does work in removing the inline action.



-- 
View this message in context: 
http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6575659
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Mungbeans

I was just checking the versions, because I downloaded my copy only last
week.  I've noticed that if you use the "Configure your download" option
that you get an older version that if you just choose "Download JQuery" or
compressed.  Does the standard download include the AJAX stuff?
-- 
View this message in context: 
http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6575608
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Choan C. Gálvez
Hi,

On 9/30/06, Mungbeans <[EMAIL PROTECTED]> wrote:
>
> > But, it works.
> > $( "#myradiobutton" ).attr( "onchange", "" ).change( function() { ... } );
>
>
> But it doesn't work :(
>
> Whenever I try to use the .attr()  function (eg: .attr( "onchange", "" ) )
> firebug tells me:
>
> "   .attr is not a function  "
>
> In other places I've had to use set() instead.

`set` is a pre 1.0 method. Upgrade to jQuery 1.0.1 or, if you prefer
to stick with an alpha version, use

$( "#myradiobutton" ).set( "onchange", "" ).change( function() { ... } );

-- 
Choan


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Mungbeans

Where in the documentation does it cover handling in-line attributes?

I must say that having different methods for JQuery and inline events seems
counter-intuitive (even if I could get the .attr() thing to work).
-- 
View this message in context: 
http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6574808
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Mungbeans

> But, it works.
> $( "#myradiobutton" ).attr( "onchange", "" ).change( function() { ... } );


But it doesn't work :(

Whenever I try to use the .attr()  function (eg: .attr( "onchange", "" ) )
firebug tells me:

"   .attr is not a function  "

In other places I've had to use set() instead.
-- 
View this message in context: 
http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6573771
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Dave Methvin

Dave Methvin schrieb:
>> Is the problem that you are attaching a new onchange event, and need 
>> to clear the old one? If so this should work:
>> $( "#myradiobutton" ).change().change( function() { ... } );

> Afaik that would call all registered change events first, then add a new
one.

Yes, my thinking was broken on that because .unchange() detaches the
event(s). 


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Jörn Zaefferer
Dave Methvin schrieb:
> Is the problem that you are attaching a new onchange event, and need 
> to clear the old one? If so this should work:
> $( "#myradiobutton" ).change().change( function() { ... } );
>   
Afaik that would call all registered change events first, then add a new 
one.

-- Jörn

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Dave Methvin

The un can either remove just the handler passed to it as the first
function, or it can remove all events if you pass it no function.  

> $( "#myradiobutton" ).attr( "onchange", "" ).change( function() { ... } );

Is the problem that you are attaching a new onchange event, and need to
clear the old one? If so this should work:

$( "#myradiobutton" ).change().change( function() { ... } );


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] unchange() - how does it work?

2006-09-29 Thread Brian
The event code only deals with "unobtrusive" events.  If you have an
inline event in the tag, you need to use the attr() method to overwrite
the "onchange" attribute with a blank string.  It sounds dumb, and... it
is.  But, it works.

$( "#myradiobutton" ).attr( "onchange", "" ).change( function() { ... } );

You can throw in unchange() anyway, for good measure, in case there may be
events registered the not-inline way as well.

This brings up an interesting question.  Should un simply deal with
this case?  I think that adding .attr( "on", "" ) to each un
would help enforce the Principle of Least Surprise.

- Brian


> I have a number of controls on a form that have a default onchange()
> function.  In some places I would like to change the onchange function to
> something else, but I find that I have been unsuccessful in removing the
> default function.
>
> I have tried several different types of commands but nothing seems to
> work.
> Here is what I have so far:
>
> $("#myform").find(".inputbox").unchange().change(function() {
>   anotherfunction();
> });
>
>
>  class="inputbox" onchange="document.myform.submit();" />
>
> --
> View this message in context:
> http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6563193
> Sent from the JQuery mailing list archive at Nabble.com.
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] unchange() - how does it work?

2006-09-29 Thread Mungbeans

I have a number of controls on a form that have a default onchange()
function.  In some places I would like to change the onchange function to
something else, but I find that I have been unsuccessful in removing the
default function.

I have tried several different types of commands but nothing seems to work. 
Here is what I have so far:

$("#myform").find(".inputbox").unchange().change(function() {
anotherfunction();
});




-- 
View this message in context: 
http://www.nabble.com/unchange%28%29---how-does-it-work--tf2356323.html#a6563193
Sent from the JQuery mailing list archive at Nabble.com.


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/