fixes #841 check javascriptEnabled before evaluating

check if javascriptEnabled is not set to false, before evaluating javascript in the page