Make permalink button work in IE8.
IE8 doesn't have addEventListener, so use attachEvent if that doesn't exist. Auditors: alpert
This commit is contained in:
parent
efaf8b57b9
commit
fa3df2db6f
|
@ -9,9 +9,15 @@ function init() {
|
|||
input.attachEvent("onkeyup", reprocess);
|
||||
}
|
||||
|
||||
permalink.addEventListener("click", function() {
|
||||
window.location.search = "?text=" + encodeURIComponent(input.value);
|
||||
});
|
||||
if ("addEventListener" in permalink) {
|
||||
permalink.addEventListener("click", function() {
|
||||
window.location.search = "?text=" + encodeURIComponent(input.value);
|
||||
});
|
||||
} else {
|
||||
permalink.attachEvent("click", function() {
|
||||
window.location.search = "?text=" + encodeURIComponent(input.value);
|
||||
});
|
||||
}
|
||||
|
||||
var match = (/(?:^\?|&)text=([^&]+)/).exec(window.location.search);
|
||||
if (match) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user