Skip to content

Instantly share code, notes, and snippets.

@rpgmaker
Created April 15, 2013 03:37
Show Gist options
  • Save rpgmaker/5385527 to your computer and use it in GitHub Desktop.
Save rpgmaker/5385527 to your computer and use it in GitHub Desktop.
Razor Long Html
<script type='text/javascript'>
var Html = (function(){
var content = jQuery('<div>');
function _write(html){
content.append(html);
}
function _clear(){
content.html('');
}
function _flush(){
jQuery(document).append(content);
_clear();
}
return {
Write: _write,
Flush: _flush
};
})();
(function(){
Html.Write('
');
Html.Write('<span data-id=\'_1\'></span>');
function _1(){ return myVariable
; }
jQuery("span[data-id='_1']").html(_1());
Html.Write('<');
Html.Write('br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
');
}).apply(Html)();
Html.Flush();
</script>
@myVariable
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment