//$(document).ready(function () {
var al_wod = 0;
var for_lang = 3;
var word_string, words;
var row1_string = '';
var i;
var word_pointer = 0;
var user_input_stream = '';
var countdown;
var row_counter = 0;
var eingabe;
var start_time = 0;
var end_time = 0;
var setval = "";
var start_time_set = 0;
var line_height = 0;
var loading = 0;
var restart_counter = 0;
var error_wpm = 0; //callback if ajax call fails => user can still see his result
var error_keystrokes = 0;
var error_correct = 0;
var error_wrong = 0;
var backspace_counter = 0;
var _gaq = _gaq || [];
var test_ausgefuehrt = 0;
var keys = {};
var input_key_value = 32;
var $inputfield = $("input#inputfield");
var $row1 = $("#row1");
var $reloadBtn = $("#reload-btn");
var $row1_span_wordnr;
$(document).ready(function () {
$("#menu").click(function () {
$("#language_list").slideToggle(1000);
});
$("#hiddenwords").val("Hindi");
$(".lang_span").click(function () {
$("#language_list").slideUp(1500);
$("#hiddenwords").val($(this).html());
restart();
//alert($(this).html());
});
restart();
//alert("end resart");
activate_keylistener();
//alert("key listernr end");
var win_width = $(window).width();
//oder "F5"-Taste abfangen
$(document).keydown(function (event) {
if (event.which == 116) {
loading = 1;
restart();
return false;
}
keys[event.which] = true;
});
$(document).keyup(function (event) {
delete keys[event.which];
});
$("#reload-btn").on('click', function () {
//location.reload();
$('#ddlTime').attr("disabled", false);
startGame();
});
});
function startGame() {
row_counter = 0;
restart_counter++;
restart();
return false;
}
function restart() {
$("#loaderdiv").css('display','block');
$("#loaderdiv").addClass('loader');
word_string = '';
row_counter = 0;
words = '';
row1_string = '';
word_pointer = 0;
user_input_stream = '';
countdown = 60;
cd_started = 0;
previous_position_top = 0;
row_counter = 0;
// alert("row counnter"+ row_counter);
eingabe = '';
start_time = 0;
end_time = 0;
start_time_set = 0;
al_wod = 0;
//just to count everything if the ajax-call fails
error_wpm = 0;
error_keystrokes = 0;
error_correct = 0;
error_wrong = 0;
backspace_counter = 0;
$("#timer").text("1:00");
$("#ajax-load").css('display', 'block');
//$("#reload-box").css('display', 'none');
$("#row1").css('top', "1px");
$("#timer").removeClass("off");
window.clearInterval(setval);
setval = "";
var lang = $("#hiddenwords").val();
if (lang != "Hindi") {
var minute = $("#hMin").val();
$.ajax({
url: "/RandWordsNew.php",
data: 'language=' + lang + '&min=' + minute,
success: function (result) {
setTimeOut(result);
}
});
} else {
var wordss = "जैसा आदमी बाद बहुत शायद हवा जल्दी उन आ आप सब पहले गीत क्या शायद तीन दो वापस विचार दुनिया कर शुरू अलग लेकिन रखना होना रोक ऊपर आदमी अभी देखा युवा सोच दूसरा खोज इसके मां अधिक भारत पानी नया कैसे विद्यालय साल किया बहुत जबतक या साल मील जीना चलो हाथ बाहर रोक तेल हमेशा ऐसा फिर देना अलग दो की जब रास्ता पैर लेकिन सूचित बाहर सीखना बंद नाम कौन सोचा द्वारा इन एक सूचित लेना याद का चलना दूर उसे जाएगा भारत चेहरा दूर बायां दुनिया केवल पिता पहले पाया साल संख्या समय चल सकता सचमुच दिन परिवार जगह सचमुच गया जवाब वाक्य तेल लिए लगभग उनके कहानी और याद छोड़ साथ जबतक जोड़ना थे पूछ छोड़ जीना डाल जल्दी सूची सकते घर सिर देश खाना जब हम दो लिखना पहाड़ नीचे एक जैसा नीचे काम कोशिश दोनों जहां नहीं अधिक दिन जैसा दिन आसपास तीन";
setTimeOut(wordss);
}
function setTimeOut(word) {
//alert(" set time out function in");
$("#ajax-load").css('display', 'none');
$(".loader").fadeOut("slow");
$("#loaderdiv").removeClass('loader');
$("#reload-box").css('display', 'block');
//alert("data is :" + word);
$("#row1").css('top', "1px");
$("#row1").css('margin-top', "1px");
words = word.split(' ');
//alert("words are :" + words);
fill_line_switcher();
p = $('#row1 span[wordnr="' + word_pointer + '"]').position();
// alert("position is:"+p);
previous_position_top = 0;
line_height = parseInt($('#row1 span[wordnr="' + word_pointer + '"]').css('line-height'));
$inputfield.val('');
$("input#inputfield").focus();
$("#row1").show();
$("#words").fadeTo('fast', 1.0);
// alert("yara ");
if (test_ausgefuehrt > 0)
_gaq.push(['_trackPageview', window.location.pathname]);
test_ausgefuehrt++;
loading = 0;
}
}
function activate_keylistener() {
//alert("key listerner in");
var android_spacebar = 0;
// Android/mobile specific function to check if inputfield contains a space-char, as the keyup function doesn't work on Android+Chrome
$(window).on("touchstart", function (event) {
$("input#inputfield").on("input", function (event) {
var value = $("input#inputfield").val();
if (value.indexOf(" ") != -1) {
android_spacebar = 1;
} else {
android_spacebar = 0;
}
});
});
$("input#inputfield").keyup(function (event) {
// alert("input key value is :" + input_key_value);
if (loading == 0) {
//loading++;
start_countdown();
}
$reloadBtn.show();
$row1_span_wordnr = $('#row1 span[wordnr="' + word_pointer + '"]');
if (event.which == 8) {
backspace_counter++;
}
if (event.which == input_key_value && $(inputfield).val() == ' ') {
$(inputfield).val('');
}
else if (event.which == input_key_value || android_spacebar == 1) { //event.which == 32 => SPACE-Taste
// alert(" space press and loading is 0");
//evaluate
var eingabe = $(inputfield).val().split(" ");
user_input_stream += eingabe[0] + " ";
//alert("eingabe is :" +eingabe[0]);
$row1_span_wordnr.removeClass('highlight-wrong');
// alert("input stream is :" + user_input_stream);
$(inputfield).val('');
if (eingabe[0] == words[word_pointer]) {
// alert("word match");
$row1_span_wordnr.removeClass('highlight').addClass('correct');
error_correct++;
error_keystrokes += words[word_pointer].length;
error_keystrokes++; //für jedes SPACE
al_wod++;
}
else {
//alert("word not match");
$row1_span_wordnr.removeClass('highlight').addClass('wrong');
error_wrong++;
error_keystrokes -= Math.round(words[word_pointer].length / 2);
al_wod++;
$(inputfield).val('');
}
//process
word_pointer++;
$row1_span_wordnr = $('#row1 span[wordnr="' + word_pointer + '"]');
$row1_span_wordnr.addClass('highlight');
p = $row1_span_wordnr.position();
// alert("postion is :"+p.top)
//console.log(p.top+"\n");
if (p.top > previous_position_top + 10) //"+ 5 ist die Toleranz, damit der Zeilensprung auch funktioniert, wenn User die Schriftart größer gestellt hat, etc."
{
// alert("p.top is greater");
row_counter++;
if (row_counter == 0) {
$("#row1").css('top', "1px");
}
else if (row_counter == 2) {
$("#row1").css('margin-top', '-98px');
}
else if (row_counter == 4) {
$("#row1").css('margin-top', '-196px');
}
else if (row_counter == 6) {
$("#row1").css('margin-top', '-294px');
}
else if (row_counter == 8) {
$("#row1").css('margin-top', '-392px');
}
else if (row_counter == 10) {
$("#row1").css('margin-top', '-490px');
}
else if (row_counter == 12) {
$("#row1").css('margin-top', '-588px');
}
else if (row_counter == 14) {
$("#row1").css('margin-top', '-686px');
}
else if (row_counter == 16) {
$("#row1").css('margin-top', '-784px');
}
else if (row_counter == 18) {
$("#row1").css('margin-top', '-882px');
}
//switch (row_counter)
//{
// case 2: $("#row1").css('margin-top', '-98px');
// case 4: $("#row1").css('margin-top', '-196px');
// case 6: $("#row1").css('margin-top', '-294px');
// case 8: $("#row1").css('margin-top', '-392px');
// case 10: $("#row1").css('margin-top', '-490px');
// case 12: $("#row1").css('margin-top', '-588px');
// case 14: $("#row1").css('margin-top', '-686px');
//}
previous_position_top = p.top;
var zeilensprung_hoehe = (-1 * line_height) * row_counter;
$row1_span_wordnr.addClass('highlight');
}
$("#inputstream").text(user_input_stream);
$inputfield.val(eingabe[1]);
} else {
if ($inputfield.val().replace(/\s/g, '') == words[word_pointer].substr(0, $inputfield.val().length))
$row1_span_wordnr.removeClass('highlight-wrong').addClass('highlight');
else
$row1_span_wordnr.removeClass('highlight').addClass('highlight-wrong');
if ($inputfield.val() == words[word_pointer].substr(0, $inputfield.val().length))
$row1_span_wordnr.removeClass('highlight-wrong').addClass('highlight');
else
$row1_span_wordnr.removeClass('highlight').addClass('highlight-wrong');
}
});
}
function start_countdown() {
// alert(1);
// $("#ddlTime option[value*='n/a']").prop('disabled', true);
$('#ddlTime').attr("disabled", true);
if (cd_started == 0) {
cd_started = 1;
setval = window.setInterval(count_down, 1000);
start_time = get_current_time().toString(16);
}
}
function count_down() {
countdown--;
var first_part;
var second_part;
first_part = Math.floor(countdown / 60);
second_part = countdown % 60;
if (second_part < 10)
second_part = '0' + second_part;
$("#timer").text(first_part + ":" + second_part);
if (countdown > 9) {
$("#timer").text("0:" + countdown);
} else if (countdown > 0) {
$("#timer").text("0:0" + countdown);
} else {
$("#timer").text("0:00");
$("#timer").addClass("off");
$("#row1").hide();
$("#rst1").text("Correct Words : " + error_correct + "\n" + "Total Key Strokes : " + error_keystrokes);
$("#span_cort").text(error_correct);
$("#span_keystrokes").text(error_keystrokes);
$("#span_wrng").text(error_wrong);
var minutes = $("#hMin").val();
var rslt = 0;
if (minutes == 120) {
rslt = Math.round(error_keystrokes / 10);
}
else if (minutes == 180) {
rslt = Math.round(error_keystrokes / 15);
}
else if (minutes == 240) {
rslt = Math.round(error_keystrokes / 20);
}
else if (minutes == 300) {
rslt = Math.round(error_keystrokes / 25);
} else {
rslt = Math.round(error_keystrokes / 5);
}
$("#span_wpm").text(rslt);
var userid = $('#userid').val();
var resultPlayerTo = "";
if (userid != "") {
getResults();
}
function getResults() {
$.ajax({
url: "saveScore.php",
data: 'userid=' + userid + '&score=' + rslt + '&error_correct=' + error_correct + '&error_wrong=' + error_wrong + '&error_keystrokes=' + error_keystrokes,
success: function (result) {
if (result != "") {
$("#processingdiv").show();
setTimeout(function () {
$.ajax({
url: "reteriveScore.php",
data: 'userid=' + userid,
success: function (result1) {
//alert(result1);
if (result1 != 1) {
$("#processingdiv").hide();
resultPlayerTo = result1;
var resultArray = resultPlayerTo.split(',');
var friendsResult = 0;
var friendsKeystrokes = 0;
for (var i = 0; i < resultArray.length; i++) {
if (i == 3) {
friendsResult = resultArray[i];
}
if (i == 2) {
friendsKeystrokes = resultArray[i];
}
switch (i) {
case 0: $("#span_cort2").text(resultArray[i]);
case 1: $("#span_wrng2").text(resultArray[i]);
case 2: $("#span_keystrokes2").text(resultArray[i]);
case 3: $("#span_wpm2").text(resultArray[i]);
}
}
if (friendsResult > rslt) {
$("#res_message2").text('Congratulations! You win the Game.');
$("#res_message2").css('color', 'green');
$("#res_message1").text('Sorry! You loss the Game.');
$("#res_message1").css('color', 'red');
}
else if (friendsResult == rslt) {
if (friendsKeystrokes > error_keystrokes) {
$("#res_message2").text('Congratulations! You win the Game.');
$("#res_message2").css('color', 'green');
$("#res_message1").text('Sorry! You loss the Game.');
$("#res_message1").css('color', 'red');
} else {
$("#res_message1").text('Congratulations! You win the Game.');
$("#res_message1").css('color', 'green');
$("#res_message2").text('Sorry! You loss the Game.');
$("#res_message2").css('color', 'red');
}
}
else {
$("#res_message1").text('Congratulations! You win the Game.');
$("#res_message1").css('color', 'green');
$("#res_message2").text('Sorry! You loss the Game.');
$("#res_message2").css('color', 'red');
}
$("#ans_result2").slideDown(1000);
} else {
$("#ans_result").slideDown(1000);
$("#processingdiv").hide();
// getResults();
}
}
});
}, 5000);
}
}
});
}
var htm = $("#ans_result").html();
$("#ans_result").css('display','block');
div_content = document.querySelector("#ans_result");
//make it as html5 canvas
html2canvas(div_content).then(function(canvas) {
//change the canvas to jpeg image
data = canvas.toDataURL('image/jpeg');
//then call a super hero php to save the image
save_img(data);
});
$("#words").fadeOut();
window.clearInterval(setval);
setval = "";
//$("#tdkeystrokes").test("y" + error_keystrokes);
//alert($("#tdkeystrokes").test());
end_time = get_current_time().toString(16);
var send_data = "sz=" + start_time + "&ez=" + end_time + "&user_input=" + user_input_stream + "&backspace_counter=" + backspace_counter + "&speedtest_id=" + $("#logo").attr("speedtest_id");
}
}
var imageurl="";
//to save the canvas image
function save_img(data){
//ajax method.
//alert('saved');
$.post('/save_jpg.php', {data: data}, function(res){
//if the file saved properly, trigger a popup to the user.
//alert(res);
if(res != ''){
// location.href ='/output/'+res+'.jpg';
imageurl='socialtypingtest.com/output/'+res+'.jpg';
}
else{
alert('something wrong');
}
});
}
function get_current_time() {
var d = new Date();
return d.getTime();
}
//String "Trim" Function
function trim11(str) {
str = str.replace(/^\s+/, '');
for (var i = str.length - 1; i >= 0; i--) {
if (/\S/.test(str.charAt(i))) {
str = str.substring(0, i + 1);
break;
}
}
alert("this is string:" + str);
return str;
}
function fill_line_switcher() {
for (i = 0; i < words.length; i++)
row1_string += '' + words[i] + ' '; //classes = NONE, green, red, highlight
$("#row1").html(row1_string);
$("#row1 span:first").addClass('highlight');
}
// });
function PlaySound(soundObj) {
var sound = document.getElementById(soundObj);
sound.Play();
}
Free Online Typing Speed Test In Dutch 1 to 5 minutes
 
Online Typing Test 10 Toppers
Your Result
Words per minute (WPM)
Keystrokes
(29 | 0 )
Correct words
Wrong words
0
You result is (better now, from previous result. Keep typing until become Master )
Supports following languages:
We also included Online Typing Test in Hindi !
You also can change time of free typing test
from 1 to 5 minute.
Visit our Facebook page to give us suggestions and your value able Feedback.
Tags: Speed test, test games, tutor,training,web,games, test for kids, test certificate,wpm free, test with certificate, words per minute,words per hour,woodland ca online typing test for 1 minutes online typing test 5 minutes typing tutor online typing games online typing test with certificate online typing test in hindi free online typing test wpm and accuracy