my code stock.com

first top script

Snippet options

Download: Download snippet as phx.js.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

var c=0;
var t,count=0;
var timer_is_on=0; //caltime variable
var ChValue;

function send(name)
{
 if(!name){
// stopCount();
 //alert('Complete');
 //document.getElementById('Run').innerHTML="Complete";
 }
 document.getElementById('Run').innerHTML=name;
 
 var ajaxRequest;
 
 try{
  
  ajaxRequest = new XMLHttpRequest();
 } catch (e){
  
  try{
   ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try{
    ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (e){
    
    alert("Your browser broke!");
    return false;
   }
  }
 }

 ajaxRequest.onreadystatechange = function(){
  if(ajaxRequest.readyState == 4)
  {
   var area = document.getElementById('top');
   area.innerHTML = ajaxRequest.responseText;
  }
 }
 ajaxRequest.open("GET", "submit.php?"+"name=" + name , true);
 ajaxRequest.send(null);
}

function show(){
  var x=document.getElementById("textarea").value;
  x = x.split("\n");
 if(count==0){
 	send(x[count]);
 	count++;
 }
 document.getElementById('time').innerHTML=c;
   c=c+1;
   if(c==21){
       	c=0;
       	send(x[count]);
		count++;
		//alert(count);
    }
   t=setTimeout("show()",1000);
/*for (i in x)
  {  
     var t=setTimeout("alert('3 seconds!')",5000);
	 //send(x[i]);
   }*/
  
}

function doTimer()
{

if (!timer_is_on)
  {
  timer_is_on=2;

  show();
  }
}

function myUrlEncode($string) {
    $entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
    $replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
    return str_replace($entities, $replacements, urlencode($string));
}

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.