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 your code. You can make it pretty simple
by adding a new jQuery method:

    jQuery.fn.attrNull = function( name, value ) {
        if( value === null ) value = "";
        return this.attr( name, value );
    };

and then just change your $(...).attr( a, b ) calls to $(...)attrNull( a, b
) - a simple text replacement.

-Mike

On Thu, Sep 10, 2009 at 10:01 AM, Junhua Gao <gaojun...@gmail.com> wrote:

>
>  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 <gaojun...@gmail.com> wrote:
> > Thanks!!
> >
> > On Fri, Sep 11, 2009 at 12:32 AM, MorningZ <morni...@gmail.com> wrote:
> >
> >>
> >> Easy fix
> >>
> >> $('#verMailDate').attr("value",data.verMailDate);
> >>
> >> to
> >>
> >> $('#verMailDate').attr("value","" + data.verMailDate);
> >>
> >>
> >>
> >>  On Sep 10, 12:17 pm, Junhua Gao <gaojun...@gmail.com> wrote:
> >> > $.getJSON('/VersionQueryJsonAction',{verID:verid},function(data){
> >> >       $('#verMailDate').attr("value",data.verMailDate);
> >> >       $('#statementName').attr("value",data.statementName);
> >> >
> >> > })//CampaignJsonAction,function,getJSON
> >> >
> >> > if data.verMailDate is null,i need it is "",not "null",who can help
> me?
> >>
> >
>

Reply via email to