[jQuery] Re: data is null,while i need ""

2009-09-11 Thread MorningZ
> That won't work. Try this test: > > alert( "" + null );  // "null" - but we wanted "" > alert vs .val() are two different things case in point: http://jsbin.com/ahivu/edit there is no "null" put in that text box

[jQuery] Re: data is null,while i need ""------BTW

2009-09-11 Thread Michael Geary
I don't recommend patching jQuery to make it work the way you want. If you do that, then you'll have to re-patch it every time you upgrade. Also if you find a plugin you want to use, it may not work because it isn't compatible with your custom version of jQuery. Instead, bite the bullet and modify

[jQuery] Re: data is null,while i need ""

2009-09-11 Thread Michael Geary
That won't work. Try this test: alert( "" + null ); // "null" - but we wanted "" This would work: $('#verMailDate').attr( "value",data.verMailDate == null ? "" : data.verMailDate ); Or if it's OK to treat 0 the same as null, this simpler code would work: $('#verMailDate').attr( "value",data.v

[jQuery] Re: data is null,while i need ""-------BTW

2009-09-10 Thread Junhua Gao
Because there are lots of place to revise and jquery1.2.1 has no such problem, which part in jquery should be revised?Thanks. On Fri, Sep 11, 2009 at 12:32 AM, MorningZ wrote: > > Easy fix > > $('#verMailDate').attr("value",data.verMailDate); > > to > > $('#verMailDate').attr("value","" + dat

[jQuery] Re: data is null,while i need ""------BTW

2009-09-10 Thread Junhua Gao
I have lots of places to revise and jquery1.2.1 has no such problem,so i want to revise jquery1.3.2, which part should i revise? thanks. On 9/11/09, Junhua Gao wrote: > Thanks!! > > On Fri, Sep 11, 2009 at 12:32 AM, MorningZ wrote: > >> >> Easy fix >> >> $('#verMailDate').attr("value",data.

[jQuery] Re: data is null,while i need ""

2009-09-10 Thread Junhua Gao
Thanks!! On Fri, Sep 11, 2009 at 12:32 AM, MorningZ wrote: > > Easy fix > > $('#verMailDate').attr("value",data.verMailDate); > > to > > $('#verMailDate').attr("value","" + data.verMailDate); > > > > On Sep 10, 12:17 pm, Junhua Gao wrote: > > $.getJSON('/VersionQueryJsonAction',{verID:verid},f

[jQuery] Re: data is null,while i need ""

2009-09-10 Thread MorningZ
Easy fix $('#verMailDate').attr("value",data.verMailDate); to $('#verMailDate').attr("value","" + data.verMailDate); On Sep 10, 12:17 pm, Junhua Gao wrote: > $.getJSON('/VersionQueryJsonAction',{verID:verid},function(data){ >       $('#verMailDate').attr("value",data.verMailDate); >       $