wait for DOM to remove attribute

use window.jQuery instead of $
This commit is contained in:
Jeffrey Guo 2014-09-04 13:01:39 +12:00
parent 8b020593b7
commit 8ea981519e
1 changed files with 5 additions and 4 deletions

View File

@ -108,10 +108,11 @@ JS;
}
$javascript = <<<JS
(function() {
var body = document.getElementsByTagName('body')[0];
body.removeAttribute('data-jserrors');
})();
if ('undefined' !== typeof window.jQuery) {
$(document).ready(function() {
window.jQuery('body').removeAttribute('data-jserrors');
});
}
JS;
$this->getSession()->executeScript($javascript);