After loading a template from a file, the structure is as follows:
[[style]].someclass{padding:10px 15px}[[/style]]
[[code]]<tr><td class="someclass">{{text}}</td></tr>[[/code]]
The template is loaded using .get() and stored in the "template" variable:
$.get('template.html', function(template) {
if (template) {
//extract css styles from [[style]]..[[/style]] etc.
}
});
How can I extract the content between these markers?
I simply need to assign the contents within the blocks ([[style]]..[[/style]], [[code]]..[/code]]) to relevant variables like var style = ..., var code = ... :)
P.S. I hope my explanation makes sense... Apologies for any language issues :)