javascript - Run code when page has loaded into the div -
i've got system, on need share true/false-value across several domains, using 3rd party cookie.
running remote cookiefile directly (iframe), works - however, when invoked ajax (with , without jquery), cookie never set. thing; has done in plain javascript without jquery, because need keep file size minimum.
i did experimenting , code did trick:
document.write("<div id='dummy'>test</div>"); document.getelementbyid("dummy").innerhtml='<object type="text/html" data="http://stats.***.com/setcookie.php"></object>';
the remote file echoes "isvalid=true" or "isvalid=false" div, piece missing:
i need process answer. @ moment, result displayed in div, need find out, when div named "dummy" changes value , react it.
the listeners below not elegant solution, know... , doesn't work, show intentions.
document.getelementbyid("dummy").onchange = function(e) { alert("do process"); } // test document.getelementbyid("dummy").onload = function(e) { alert("do process"); }
any idea how handle result further processing?
closing... did not find solution without using external libraries, i'm using minified.js. file size bit more acceptable , plan remove unneccesary methods in order reduce size more.
low file size essential, since millions of requests per week made.
Comments
Post a Comment