Function letswin() not working. I couldnt find a way to fix.
var pathArray = window.location.pathname.split( '.html' );
var pathArray = pathArray.reverse();
var pathArray = pathArray .join('');
var pathArray= pathArray .split('/');
var bidnum=pathArray[3];
$(document).ready(function(){
$('body').append("<div id=\"cdjs\" style=\"position: absolute; top: 30px; background-color: gray; box-shadow: 0px 0px 0px 3px; left: 30px;\" onClick=\"letswin()\">Click to start</div>");
});
function checkandbid(){
$.get("http://www.bigibid.com/LiveResponder/LR.bid?_as="+bidnum, function(data){
Marray = data.split("'te':'")
time = Marray[1].split("'")
time = time[0]
$('#cdjs').html(time);
if (time < 2 && able==1){
able=0;
$('#ctl00_ContentPlaceHolder1_ibBid').click();
} else {
able=1;
}
});
}
function letswin(){
setInterval(checkandbid, 300);
}
here you can use jsFiddle
You could do
fiddle here http://jsfiddle.net/LKZcT/6/