From adc93e85990b644194c679f528225deed9fdaa85 Mon Sep 17 00:00:00 2001 From: Julian Andrews Date: Tue, 15 Mar 2016 10:11:34 -0600 Subject: Fixed #26357 -- Allowed admin popups to work on links added after page load. --- docs/internals/contributing/writing-code/javascript.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/internals/contributing/writing-code') diff --git a/docs/internals/contributing/writing-code/javascript.txt b/docs/internals/contributing/writing-code/javascript.txt index 25a46695c3..3d10c48f00 100644 --- a/docs/internals/contributing/writing-code/javascript.txt +++ b/docs/internals/contributing/writing-code/javascript.txt @@ -24,6 +24,12 @@ Code style JSHint will be run when you run the JavaScript tests. We also recommended installing a JSHint plugin in your text editor. +* Where possible, write code that will work even if the page structure is later + changed with JavaScript. For instance, when binding a click handler, use + ``$('body').on('click', selector, func)`` instead of + ``$(selector).click(func)``. This makes it easier for projects to extend + Django's default behavior with JavaScript. + .. _javascript-patches: JavaScript patches -- cgit v1.3