The javascript I am using:
javascript: c = \'{unit}, ({coords}) {player} |{distance}| {return}\';
p = [\'Scout\', \'LC\', \'HC\', \'Axe\', \'Sword\', \'Ram\', \
There are two possibilities:
editInput
is a typo, and the actual id of that element is different (ids are case-sensitive).</body>
closing tag, or wrap it in an event handler for the load
event of window
or the DOMContentLoaded
event of document
.EDITED How to wrap your code:
window.onload = function() {
//your code here
};
In my case it was a conflict between slider and form validator as they were located on different pages but javascript file would of target both of them simultaneously, so all pages that had no slider would come up with "Cannot read property 'parentNode' of null" error, so I have added to the slider If statement:
if(document.getElementById("mainImage")){
var myImage = document.getElementById("mainImage");
var linkElement = myImage.parentNode;
that solved my problem, try it