Last active
December 29, 2015 01:49
-
-
Save kamiyam/7595797 to your computer and use it in GitHub Desktop.
ejs-locals と blocks.xxx を使った URLごとのスクリプトローディング
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<!-- this block is main content area --> | |
</div> | |
<% | |
var fotter_script = (function () {/* | |
<script> | |
(function(d,w,$){ | |
$(function(){ | |
return false; | |
}) | |
})(document,window,jQuery) | |
</script> | |
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]; | |
%> | |
<% block('footer_scripts', fotter_script) -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ejs-blocks-tips</title> | |
<%-scripts%> | |
<%-stylesheets%> | |
</head> | |
<body> | |
<%-blocks.header_scripts%> | |
<div id="content"> | |
<%- body %> | |
</div> | |
<!-- | |
Client-side Javascript | |
======================== | |
--> | |
<%-blocks.footer_scripts%> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment