flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OmPrakash Muppirala <bigosma...@gmail.com>
Subject Re: FlexJS, JQuery and FDT
Date Wed, 20 Apr 2016 23:46:07 GMT
Are you using the jquery.swc from the externs file, or are you using the
dts2as tool to create one from a definitely typed definition file?

I think I remember seeing the one from our externs code work fine with the
$ call.

Thanks,
Om

On Wed, Apr 20, 2016 at 4:13 PM, Harbs <harbs.lists@gmail.com> wrote:

> Replacing “$” with “jQuery” makes the warnings go away. Why would “$” be
> different than “jQuery”? It sounds to me like a bug in the definitions.
>
> jQuery always returns a JQuery object which has many defined methods. One
> of those is attr.
>
> On Apr 21, 2016, at 1:50 AM, Alex Harui <aharui@adobe.com> wrote:
>
> > IMO, this is why Jquery is painful for strong typing.
> >
> > I think you may need to do casting:
> >
> >       ($("#topcoat") as Whatever).attr(..)
> >
> > Where Whatever is a "type" that has an attr function.
> >
> > And you may need to use @flexjsignorecoercion or other compiler options
> to
> > not actually do the "as" test in the JS output.
> >
> > Good luck,
> > -Alex
> >
> >
> > On 4/20/16, 3:46 PM, "Harbs" <harbs.lists@gmail.com> wrote:
> >
> >> Here’s an example:
> >> $("#topcoat").attr("href", "css/topcoat-desktop-lightlight.min.css");
> >>
> >> It looks like “$” is defined as an object.
> >>
> >> Here’s the exact warnings I’m getting:
> >>
> >> Could not resolve variable (may be a dynamic member) 'attr' at line 43
> >> column 19.   ThemeManager.as /MyExtension/src/com/unhurdle   Unknown
> Flash
> >> Problem
> >> Maybe invoking a non function. Found
> >> $("#topcoat").attr("href","css/topcoat-desktop-lightlight.min.css"); at
> >> line 43 column
> >> 5.   ThemeManager.as /MyExtension/src/com/unhurdle   Unknown Flash
> Problem
> >>
> >> And yes, js/libs/jquery.swc is included. If I remove it, I get an error
> >> that “$” is not defined instead of a warning.
> >>
> >> On Apr 21, 2016, at 1:39 AM, Alex Harui <aharui@adobe.com> wrote:
> >>
> >>>
> >>>
> >>> On 4/20/16, 3:34 PM, "Harbs" <harbs.lists@gmail.com> wrote:
> >>>
> >>>> Does anyone know if there’s a way to get FDT to not flag JQuery
> >>>> expressions with “could not resolve variable” and "Maybe invoke
a non
> >>>> function” warnings?
> >>>
> >>> What kind of expressions result in this output?  Are you sure you have
> >>> the
> >>> jquery.swc from the externs on the -external-library-path?
> >>>
> >>> -Alex
> >>>
> >>
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message