Skip to content

Commit

Permalink
Fixed DomReady test throwing random JS errors. Removed unnecessary ju…
Browse files Browse the repository at this point in the history
…nk and implemented the required APIs for DomReady.js to be loaded without anything else.
  • Loading branch information
subtleGradient committed Aug 15, 2010
1 parent d5506db commit dd68fef
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Source/Utilities/DomReady.test.php
Expand Up @@ -28,7 +28,10 @@ function flushPause($pause = 0){
<!DOCTYPE html>
<html>
<head>
<script>var START_TIME = +new Date</script>
<script>
var START_TIME = +new Date
function isNotLoaded(){ return !!(window.PARSED && !window.ONLOAD) }
</script>
<script>

var Browser = {}
Expand Down Expand Up @@ -62,6 +65,8 @@ function log(message){
}
}

window.addEvent = function(){}

function DomReady(fn){
domreadyCallbacks.push(fn)
}
Expand All @@ -76,7 +81,7 @@ function DomReady(fn){
// echo $pkg->build(Array( 'DomReady' ), Array(), Array(), Array());
?>

document.write('<script src="DomReady.js?_=' + (new Date) + '"><\/script>')
document.write('<scr'+'ipt src="DomReady.js?_=' + (new Date) + '"><'+'/script>')
</script>

<script>
Expand Down Expand Up @@ -343,10 +348,6 @@ function report(){

poll()

// // // // // // // // // // // // // // // // // // // // //

function isNotLoaded(){ return !!(window.PARSED && !window.ONLOAD) }

</script>
</head>
<body
Expand Down Expand Up @@ -386,11 +387,11 @@ function isNotLoaded(){ return !!(window.PARSED && !window.ONLOAD) }
<img height=16 width=16 onload="window.IMG_ONLOAD = true; somethingHappened('img[onload][src=' + this.src + ']')" src="http://projects.subtlegradient.com/domready/big_image.jpg">
<script>document.write("<img height=16 width=16 onload=\"window.IMG_ONLOAD = true; window.IMG_ONLOAD_UNCACHED = true; somethingHappened('img[onload][src=' + this.src + ']')\" src=\"http://projects.subtlegradient.com/domready/big_image.jpg?_=" + +new Date + "\">")</script>

<script
<!-- <script
onload="window.SCRIPT_ONLOAD = true; somethingHappened('script[onload][src=about:blank]')"
onreadystatechange="somethingHappened('script[src=about:blank][onreadystatechange]', this.readyState)"
onerror="somethingHappened('script[src=about:blank][onerror]')"
src="about:blank"></script>
src="about:blank"></script> -->
<script
onload="window.SCRIPT_ONLOAD = true; somethingHappened('script[onload]')"
onreadystatechange="somethingHappened('script[onreadystatechange]', this.readyState)"
Expand Down

0 comments on commit dd68fef

Please sign in to comment.