Skip to content

Instantly share code, notes, and snippets.

@mehdimehdi
Created October 29, 2016 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mehdimehdi/842551a98d0fad0590bc89e8634272d3 to your computer and use it in GitHub Desktop.
Save mehdimehdi/842551a98d0fad0590bc89e8634272d3 to your computer and use it in GitHub Desktop.
{% extends "base.html" %}
{% block content %}
<div>
Something special in my about page with a <button id="aboutbutton">about button</button>.
Something less special with some <button>other button</button> which is the same as the home.html button.
</div>
<script>
/* handle the about page button */
$("#aboutbutton").click(function(){
/* do something that is specific to about page. */
});
/* handle the special button */
$("#otherbutton").click(function(){
/* do something that should also work accross about.html and home.html */
});
</script>
{% endblock %}
<html>
<head></head>
<body>
{% block content %}{% endblock %}
</body>
</html>
{% extends "base.html" %}
{% block content %}
<div>
Something special in my home page with a <button id="homepagebutton">button</button>.
Something less special with some <button id='otherbutton'>other button</button>.
</div>
<script>
/* handle the home page button */
$("#homepagebutton").click(function(){
/* do something that is specific to homepage. */
});
/* handle the special button */
$("#otherbutton").click(function(){
/* do something that should also work accross about.html and home.html */
});
</script>
{% endblock %}
{% extends "base.html" %}
{% block content %}
<div>
Some other page that does some very simple stuff.
</div>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment