Friday, August 20, 2010

Few template engines in Javascript to render from json to html

Fetching JSON object through ajax call, and render it to HTML is pain, we have to prepare html as a string by parsing json object and will have to assign the string to html element.

To simplify this , We can use the following JavaScript templating engines to make life easier!!

Few examples of JTemplates:


  1. http://dotmac.rationalmind.net/2010/05/rotating-content-with-jquery-jtemplates-ajax/

  2. http://encosia.com/2008/06/26/use-jquery-and-aspnet-ajax-to-build-a-client-side-repeater/

  3. http://johnnycoder.com/blog/2008/12/18/jtemplates-with-jquery-ajax-and-json/

  4. http://www.codedigest.com/Articles/jQuery/225_Creating_a_Simple_AJAX_Master-Details_View_Using_jQuery_JSON_and_jTemplates_in_ASPNet.aspx  
Among these three, I prefer JTemplate template engine. Practically using it now and found it's good and cool.

    Thursday, August 12, 2010

    One more good brower

    I am fan of Google chrome and Firefox.
    Its awesome, Epic is the new one and developed by Indian company in Bangalore.
    Try this out!!!
    http://www.epicbrowser.com/

    Form submit issue in javascript with IE6

    Generally we will write document.frmRegistration.submit(); to submit the form in javascript. This will work in all other browsers except IE6. Here "frmRegistration" is the form name.

    To make it work this in IE6, it should be written as:.

    document.getElementById('frmRegistration').submit();
    Note: Here "frmRegistration" is the element id not the form name.

    This works in IE6 as well as in all other browsers.