#1624 Fanquery. Jquery with Fantom

kaushik Fri 26 Aug 2011

Fanquery let's you use Jquery and it's plugins in Fantom.

Try Fanquery online here

Or read the docs

Few examples:

Jq("#button").click{
  Jq("#my-div").fadeOut(["duration": Jq.slow]).fadeIn
}

Jq("#link").fancybox

The goal is match Jquery's syntax as much as possible and bring in it's myriad of plugins, yet preserve type safety(even for plugins) and the beauty of Fantom

Fanquery does not depend on tales and can be used for writing the javascript part of the a web application even when other parts are not written in Fantom(infact fanquery was born out of one such project).

Let me know what you think?

kevinpeno Fri 26 Aug 2011

Made my day :)

Place to provide contributions? (github, etc)

kaushik Fri 26 Aug 2011

Thanks Kevin!

Here's the source code and

here's some test code I wrote (not very good, but good enough to understand how to use various methods)

I guess we should make fanquery better in two ways:

  • Here's how you make(or just convert) a plugin
  • Though I use jquery in many projects, I am myself not a jquery expert. If you take a look at JqBase.fan you will see all the jquery methods currently supported. There's definitely a lot of scope for improvement here..

Nothing's in Hg yet. I will create one in day or two.

mail me: [email protected] if you run into anything.

kaushik Sat 22 Oct 2011

Just updated Fanquery to 0.2 with more jquery methods requested by some of you and the ability write quick native code.

Here are some examples of using fanquery to get you motivated.

The source code is here https://bitbucket.org/ksat/fanquery/

Try it out and let me know if you like it. Thanks.

Login or Signup to reply.