Create a Makeshift JavaScript Templating Solution

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
6,663
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 9, 2011

Sometimes, you don't require a high-quality templating solution, but you still need to keep from mixing lots of HTML and JavaScript. In these cases, a simple templating solution can go a long way.

Full tutorial here: http://net.tutsplus.com/tutorials/javascript-ajax/create-a-makeshift-javascri...

Source Code: http://jsbin.com/exugah

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (nettutsplus)

  • I like this one, good job! just one little thing with regards to possible speed optimization... storing the replaced text in a variable first and only changing innerHTML at the very end (after the FOR loop) will speed this up quite a bit, as the DOM would only need to be updated once ;-)

  • @zathruswriter Yeah - forgot to do that during the video. Refer to the article on Nettuts+ for the updated version. I also included a more automated solution that I personally use.

see all

All Comments (11)

Sign In or Sign Up now to post a comment!
  • Hellow, I was wondering if you can teach me how to add other stuff to the templating sistem like texto to explain whats about the article or more thigs.

    Thank you. Martin

    PD: I tried to put it like you teached us but it had a few problems

  • The timing for this could not have been better.

  • Wow! Mind-blowingly quick and informative.

  • I love this video! Thanks for sharing. I'm just curious, on a philosophical level, why would one use Javascript to build templates in the first place? Is this assuming the absence of a backend solution such as PHP?

  • Simple and great, thank you.

  • Yeah, that shows one of the neat aspects of Javascript, thanks fo that :)

  • WAOW, i don't hate Javascript anymore.

  • remarkable!!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more