Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of specifying messenger element #3

Closed
TrevorBurnham opened this issue Feb 4, 2013 · 8 comments
Closed

Example of specifying messenger element #3

TrevorBurnham opened this issue Feb 4, 2013 · 8 comments

Comments

@TrevorBurnham
Copy link
Contributor

The docs include an example with the line

messenger = new ActionMessenger $('div#message-container')

but ActionMessenger is scoped within the messenger.js file, and besides, the argument would have to be el: $('div#message-container').

I believe the simplest fix is to change the line in the docs to

messenger = $('div#message-container').messenger()
@mjball
Copy link

mjball commented Feb 4, 2013

That overspecified selector makes me a sad 🐼.

@zackbloom
Copy link
Contributor

But how will people ever understand how jquery works if I don't show it to them!?!?!?!

@mjball
Copy link

mjball commented Feb 4, 2013

@zackbloom lolidk

@zackbloom
Copy link
Contributor

Obvi:

var out = $('<ul>');
$.each(new Array(a), function(){ out.append($('<li>')); })
$.each(new Array(b), function(){ out.append($('<li>')); })
alert(out.children().length);

It's the only way.

@roderyc
Copy link

roderyc commented Feb 4, 2013

@zackbloom pls publish as jq plugin.

@mjball
Copy link

mjball commented Feb 4, 2013

@roderyc v0.1a maybe. Too efficient for a v1 release.

@TrevorBurnham
Copy link
Contributor Author

FYI, the example still doesn't work when you click "Run" because there's no element called #message-container on the page. Some other examples (like hookBackbone) have "Run" buttons but are no-ops as well. Maybe there should be separate "Examples" and "Advanced" sections, with all the runnable examples in the former.

@zackbloom
Copy link
Contributor

Yea, I just made them all runnable in the interest of consistency. Fleshing out those others is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants