Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Change to ready

  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Change to ready

    Hey i've got this code and i want to change it for ready not to wait for confirmation. what can i do?
    Code:
      
      var closing = false;
      var http = getHTTPObject();
      var tab = '';
      var check = 1;
    	
    	function doauth() {
    		if (closing == false) {
    			setTimeout("doauth();", 10);
    			http.open("GET", "http://adscendmedia.com/gwchecker.php?aff=14356&sid=&prf=15014", true);
    			http.send(null);
    		}
    	}
    	
    	function handleHttpResponse() {
    		if (http.readyState == 4) {
          if (http.responseText != '') {
            rslt = http.responseText;
            arr = rslt.split("||");
            if (arr[0] == '14356_15014'){
              closing = true;
              if (arr[1] == '0'){
                top.location.href = document.referrer;
              } else{
                              top.location.href = arr[1];
                            }
            }
    			}
    			// http.onreadystatechange = function(){};
          // http.abort();
    		}
    	}
    	
    	function getHTTPObject() {
    		var xmlhttp;
    		/*@cc_on
    		@if (@_jscript_version >= 5)
    			try {
    				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    			} catch (e) {
    				try {
    					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    				} catch (E) {
    					xmlhttp = false;
    				}
    			}
    		@else
    		xmlhttp = false;
    		@end @*/
    		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    			try {
    				xmlhttp = new XMLHttpRequest();
    			} catch (e) {
    				xmlhttp = false;
    			}
    		}
    		return xmlhttp;
    	}
    	
    	
    
      function openoffer(offerid,fromtab) {
                  if (offerid == 14475){
                newwindow = window.open("http://adscendmedia.com/click.php?aff=14356&camp=14475&crt=0&gate=15014&sid=&p=aHR0cDovL3d3dy5lcGljZnJlZXByaXplcy5jb20vY2xhaW0ucGhwP3ByaXplaWQ9Nw%3D%3D", '_blank');
              }
                      if (offerid == 15041){
                newwindow = window.open("http://adscendmedia.com/click.php?aff=14356&camp=15041&crt=0&gate=15014&sid=&p=aHR0cDovL3d3dy5lcGljZnJlZXByaXplcy5jb20vY2xhaW0ucGhwP3ByaXplaWQ9Nw%3D%3D", '_blank');
              }
                      if (offerid == 15014){
                newwindow = window.open("http://adscendmedia.com/click.php?aff=14356&camp=15014&crt=0&gate=15014&sid=&p=aHR0cDovL3d3dy5lcGljZnJlZXByaXplcy5jb20vY2xhaW0ucGhwP3ByaXplaWQ9Nw%3D%3D", '_blank');
              }
                      if (offerid == 14941){
                newwindow = window.open("http://adscendmedia.com/click.php?aff=14356&camp=14941&crt=0&gate=15014&sid=&p=aHR0cDovL3d3dy5lcGljZnJlZXByaXplcy5jb20vY2xhaW0ucGhwP3ByaXplaWQ9Nw%3D%3D", '_blank');
              }
                      if (offerid == 12087){
                newwindow = window.open("http://adscendmedia.com/click.php?aff=14356&camp=12087&crt=0&gate=15014&sid=&p=aHR0cDovL3d3dy5lcGljZnJlZXByaXplcy5jb20vY2xhaW0ucGhwP3ByaXplaWQ9Nw%3D%3D", '_blank');
              }
                document.getElementById(fromtab).style.display = 'none';
        document.getElementById('spnChecking').innerHTML = 'Checking for completion...';
        document.getElementById('divWait').style.display = 'block';
        tab = fromtab;
        check = 1;
        changeCheck();
        if (window.focus) {newwindow.focus();}
      }
      
      function openpp() {
        newwindow = window.open("https://adscendmedia.com/pp_click.php?aff=14356&gate=15014&sid=&p=aHR0cDovL3d3dy5lcGljZnJlZXByaXplcy5jb20vY2xhaW0ucGhwP3ByaXplaWQ9Nw%3D%3D", '_blank');
      }
      
      function closeWait() {
        document.getElementById('divWait').style.display = 'none';
        if(tab!=''){document.getElementById(tab).style.display = 'block';}
        check = -1;
      }
      
      function changeCheck() {
        if (check == 1){
          document.getElementById('spnChecking').innerHTML = 'Checking for completion...';
          check = 2;
          setTimeout("changeCheck();", 3000);
        } else if (check == 2){
          document.getElementById('spnChecking').innerHTML = 'Offer not yet completed.';
          check = 1;
          setTimeout("changeCheck();", 1600);
        }
      }
      
        function ChangeTab(whichtab) {
        closeWait();
    		if (whichtab == "survey") {
          		  		  		  			document.getElementById('gw_offers').style.display = 'block';												tab='gw_offers';
    		} else if (whichtab == "cell") {
          		  		  		  			document.getElementById('gw_offers').style.display = 'none';												tab='divCell';
    		} else if (whichtab == "paypal") {
          		  		  		  			document.getElementById('gw_offers').style.display = 'none';												tab='divPayPal';
    		} else if (whichtab == "try") {
          		  		  		  			document.getElementById('gw_offers').style.display = 'none';												tab='divTry';
    		}
      }

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,274
    Thanks
    10
    Thanked 581 Times in 562 Posts
    Quote Originally Posted by suzako69 View Post
    Hey i've got this code and i want to change it for ready not to wait for confirmation. what can i do?
    since it launches a pop-up, you can only run the script as the result of clicking a link, you can't just schedule it to run un-attended.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •