npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jquery-hx

v0.0.5

Published

jQuery extern for Haxe.

Downloads

14

Readme

NOTICE

Part of jQueryExtern is being merged back to the Haxe std lib, resulting in a new extern in the Haxe std lib. If you're using Haxe 3.3+, you should switch to the new std extern. You may checkout the haxe3.3 branch of jQueryExtern, which is a drop-in replacement to the new std extern with advanced functionalities.


jQueryExtern Build Status

jQuery extern for Haxe.

Currently supports jQuery version up to 1.11.3 / 2.1.4. Requires Haxe 3.1.0+.

You may check my blog for updates.

Download and Install

Install via haxelib: haxelib install jQueryExtern

Then put -lib jQueryExtern into your hxml.

##Usage

Typically:

import jQuery.*;
 
class Main {
	static public function main():Void {
		new JQuery(function():Void { //when document is ready
			//your magic
		});
	}
}

It is same as how you use jQuery in JS. But instead of $, you refer jQuery as JQuery.

eg. Hiding all li object:

new JQuery("li").hide(); //same as $("li").hide() in JS

Static methods of jQuery can be accessed from JQuery._static.

eg. A ajax example:

JQuery._static.get("ajax/test.html", function(data) {
	js.Lib.alert(data);
});

Remember jQueryExtern is simply an extern, you have to link jQuery in your html file.

eg. In your <head>:

<!-- from jQuery's CDN (http://jquery.com/download/#using-jquery-with-a-cdn) -->
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>

<!-- Your haxe compiled script: -->
<script type="text/javascript" src="Main.js"></script>

js.JQuery in haxe std lib VS jQueryExtern

In fact, since both js.JQuery in haxe std lib and jQueryExtern are just extern files, they can be used in same project.

The following will compile and run perfectly.

function takesJQueryExtern(j:jQuery.JQuery):Void {
	trace(j);
}
function takesJsJQuery(j:js.JQuery):Void {
	trace(j);
}

var div = new js.JQuery("<div></div>");
takesJQueryExtern(untyped div);
takesJQueryExtern(cast div);

var div = new jQuery.JQuery("<div></div>");
takesJsJQuery(untyped div);
takesJsJQuery(cast div);

Like jQueryExtern?

Support me to maintain it -> http://www.patreon.com/andyli

License

jQueryExtern is released in the public domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

jQuery's license can be found at http://jquery.org/license.