Results for tag json

  • Requesting remote JSON or XML from a Smarty template
    Joor Loohuis, 2010-12-19
    Occasionally it is necessary to get data from another domain to display on a webpage. Using Smarty templates it is very easy to fetch and display remote data in JSON or XML format.
  • Passing complex data from Smarty to JavaScript
    Joor Loohuis, 2009-11-13
    Modern web applications frequently need to process complex data with JavaScript. Typically, these data are requested separately through AJAX calls, but if the data do not change frequently, it is probably easier to output JSON in the (X)HTML, and let JavaScript take it from there. The Smarty template engine makes this more or less trivial.