jquery - How to Force Click on All "Like" Links on Facebook.com via JavaScript? -
if i'm on http://facebook.com , use firebug or other console run javascript on site directly... possible force links trigger appropriate post
s https://www.facebook.com/ajax/ufi/like.php? have tried following quick , dirty method:
var s = document.createelement("script"); s.src = "http://code.jquery.com/jquery-latest.min.js"; s.type = "text/javascript"; document.getelementsbytagname("head")[0].appendchild(s); $(".ufilikelink").click();
... but, of course, doesn't work. wondering method might take plain js or otherwise force event. thanks!
var s = document.createelement("script"); s.src = "http://code.jquery.com/jquery-latest.min.js"; s.type = "text/javascript"; document.getelementsbytagname("body")[0].appendchild(s) console.log($) s.onreadystatechange = function() {console.log($)}; s.onload = function() { console.log($)};
notice console.log($) throws undefined, think jquery not loaded @ time added invoke $().click().
so wait script load , ready. s.onreadystatechange = function() {console.log($)}; s.onload = function() { console.log($)};
Comments
Post a Comment