Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About xcislav

  • Rank
  1. I need to cut the program to the final logic cut. It's now ~10 times smaller, although it's as far as I could get in my understanding now.Given two identical text strings. When you write in <input> you should write letters which have to be identical to the given line. And while you're typing the cursor moves until the excercise_results().My program is still big, and I need some help in understanding it's actions. I know that each text contains a final dot and a space after it. But I couldn't link this with the number "2" in for loop (after hiding the color of the <p >passage -...te
  2. <?php$z=$_POST['l'];$db=new PDO('mysql:host=localhost;dbname=test;charset=utf8','root','hyuiuik');$db->exec("INSERT INTO AJAXTYPE (keyline) VALUES ('$z');");?> <input id="r"><div id="o"></div><div id="a"></div><script>s=0;var typetext;document.getElementById('r').addEventListener('keyup', oku);document.getElementById('r').addEventListener('blur', onbl);var j=0;function oku(){if (s){e=Date.now();typetxt=document.getElementById('r').value.substr(j);jupd();j++;}else{s=Date.now();typetxt=document.getElementById('r').value;jupd();document.getElementById(
  3. I'm writing for those who will search and find mine for their use and those who have motivation for their goal. But I'm not writing for those who won't help or will advice something HOW OTHERS SHOULD BE or flame or blame or offtop.
  4. Server side. <?php $z=$_GET['l']; $db=new PDO('mysql:host=localhost; dbname=test;charset=utf8','root','hyuiuik');$db->exec("UPDATE AJAXTYPE SET keyline=concat(keyline,'$z');");?> This works. <input onkeyup="j=new XMLHttpRequest();j.open('GET', '/jpostkdb.php?l='+this.value.substr(z));j.send();z=z+1;"/><script>z=0</script> This not. <input onkeyup="if (z) {j=new XMLHttpRequest();j.open('GET', '/jpostkdb.php?l='+this.value.substr(z));j.send();z=z+1;} else z=0"/> This gives more output (the more keyup the more excessive the output is). <input onkeyup="if (t
  5. Cut the code: <input onkeyup="s?e=Date.now():s=Date.now()"onblur="c=this.value.length;this.value+=c/(e-s)"><script>s=0</script> ☑ 113 <input onkeyup="s?e=Date.now():s=Date.now()"onblur="c=this.value.length;this.value+=c/(e-s)"> Ø 93
  6. plus one ("+1") "like button"-voting system I just want to have non-authorization (non-voting "system" at all - just for like button). I want to click "Like"-button key and want to have other users which visit this webpage to see this. Like-button with no additional things (no dislike) just: 1. Press - HTML/Javascript 2. Send PHP (PDO!) 3. Receive Textfile (may be.. mysql) *it has to be as simple as it could be* 4. Show +1, which would be visible to other visitors (ajax/js - optional). That example to be working. I have mysql and apache and php PDO (php5.5.6)! This is with no PDO a
  7. It's the same (smaller and -"brain pain"): <textarea id="b" onblur="clc();"></textarea><script>t=0;x=document.getElementById('b');x.onkeypress=function(){t==0 ? s=new Date() : e=new Date();t=1;}function clc(){d = e.getTime() - s.getTime();c = b.value.length;b.value += +c+"s in "+d+"ms: "+c/d+" cpms";}</script> How the HE₺₺ does 1st work?
  8. Here's a fragment of working code with "functions inside functions". It has a "= function" definition. Here the word function is used too many times. It's a function inside a function and inside the next one. And finally the last function calls the first with all of them inside.Actually, the program has a very simple algorithm of counting typing speed:1 Starts the timer on a key-press2 Iterates every time as every next key is pressed and the stop point is in it's last key-press3 Outputs the delta in milliseconds (even without any conversion). The whole program: <script type="t
  • Create New...