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

Dynamic page generation fail #76

Closed
Enelar opened this issue Jan 19, 2014 · 4 comments
Closed

Dynamic page generation fail #76

Enelar opened this issue Jan 19, 2014 · 4 comments

Comments

@Enelar
Copy link

Enelar commented Jan 19, 2014

My whole project using client-side page generation.
I cant get your system work with code like this(changed, because github markdown mess up with me):

$('body').append(' img data-src="holder.js/200x200" /');

@imsky
Copy link
Owner

imsky commented Jan 19, 2014

If you're running that inside a $(document).ready(), it's likely you're seeing a race condition. After your append, execute Holder.run().

@Enelar
Copy link
Author

Enelar commented Jan 19, 2014

Whoa.. unexpected.. feature. So i should run() after every EJS rendered, in hope that it contains image?
Well, thanks!

@Enelar Enelar closed this as completed Jan 19, 2014
@imsky
Copy link
Owner

imsky commented Jan 19, 2014

You can run Holder.run on a set of images, so that if you update an element, you only have to iterate over images inside that element, if any exist. This can be automated if you register a callback for your rendering function as well.

@Enelar
Copy link
Author

Enelar commented Jan 19, 2014

Yep. Right now i am using http://placehold.it/, because my boss NEED solution NOW.
But later i am planning create jquery plugin.

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

2 participants