BorisMoore / jquery-tmpl

The original official jQuery Templates plugin. This project was maintained by the jQuery team as an official jQuery plugin. It is no longer in active development, and has been superseded by JsRender.
3.23k stars 1.01k forks source link

Is it possible to return just the rendered HTML code? #159

Closed martinbean closed 13 years ago

martinbean commented 13 years ago

I'm building an application with the Google Maps API which contains markers that create InfoWindows when clicked.

Obviously an InfoWindow requires a content string, so I'm wondering if I can use this plugin to create the InfoWindow HTML string that has my data injected from an API?

For example, my JavaScript code would:

  1. Create a map in the <div id="map"> element
  2. Do an AJAX call to my API's URL for the list of items
  3. Create InfoWindow HTML template using jQuery TMPL plugin
  4. Iterate over items fetched via step 2, creating a marker for each and setting up my event listeners
  5. When a marker is clicked the InfoWindow's content is changed using my template HTML injected with item data

Is this possible? I'm unsure as to how I would use the chaining options available (.appendTo() etc) in a Google Maps InfoWindow scenario?

Thanks in advance.

rdworth commented 13 years ago

Thanks for taking the time to submit this issue. Just wanted to let you know this plugin is no longer being actively developed or maintained by the jQuery team. See README for more info.

martinbean commented 13 years ago

Oh. That's a blow :-(

BorisMoore commented 13 years ago

Doing string-based rendering without a DOM dependency is one of the goals of the 'next-generation' work going on at JsRender. Take a look at this post for more context.