Index: chrome/common/extensions/docs/static/options.html |
diff --git a/chrome/common/extensions/docs/static/options.html b/chrome/common/extensions/docs/static/options.html |
index e0cc4b4b7b990513a5bc628f04cd5e055c908d99..5f8e273474f8f10c37bec703961dd54536b70d66 100644 |
--- a/chrome/common/extensions/docs/static/options.html |
+++ b/chrome/common/extensions/docs/static/options.html |
@@ -16,10 +16,7 @@ |
Here is an example options page: |
-<pre> |
-<html> |
-<head><title>My Test Extension Options</title></head> |
-<script type="text/javascript"> |
+<pre>// Save this script as `options.js` |
// Saves options to localStorage. |
function save_options() { |
@@ -50,10 +47,16 @@ function restore_options() { |
} |
} |
} |
+document.addEventListener('DOMContentReady', restore_options); |
+document.querySelector('#save').addEventListener('click', save_options); |
+</pre> |
-</script> |
+<pre> |
+<html> |
+<head><title>My Test Extension Options</title></head> |
+<script src="options.js"> |
-<body onload="restore_options()"> |
+<body> |
Favorite Color: |
<select id="color"> |
@@ -64,7 +67,8 @@ Favorite Color: |
</select> |
<br> |
-<button onclick="save_options()">Save</button> |
+<div id="status"></div> |
+<button id="save">Save</button> |
</body> |
</html> |
</pre> |