JavaScript Function urldecode, in_array, implode and explode

JavaScript Function urldecode, in_array, implode and explode

In this post, we will be making JavaScript  functions such as urldecode in_array implode explode urldecode function urldecode (str) { return decodeURIComponent(str.replace(/+/g, ' ')) } in_array in_array equivalent function in JavaScript 1.6 Array.indexOf , but it is not supported in older browsers. function in_array(needle, haystack) {   var key = '';     for (key in haystack) {       if (haystack[key]

Pure Javascript Countdown Timer

Tech Dasher

Hey guys! Countdown timers used for New website launching, Offering Deal or Shopping deadlines in Ecommerce website, Movie release, Shows, online exams and more. Countdown timers can be useful for all online activities. I've share the simple countdown timers script using pure JavaScript. Input format: var target_date = new Date(2020,6,28,0,0,00).getTime(); //var target_date =

Jquery Capture cmd + enter / control + enter Event

Tech Dasher

In Social network, the alternative way to submitting the status/message by pressing control+enter.  Sample script for submitting message by using Jquery. <script type="text/javascript"> $(function (){ $(document).on("keydown", "#text", function(e)  { if ((e.keyCode == 10 || e.keyCode == 13) && (e.metaKey || e.ctrlKey)) alert("Ctrl Enter Pressed") ; }); }); </script> <textarea  id="text"></textarea>

Javascript Dynamically Change Web Pages Title

Tech Dasher

The content between tags display at the top of the browser window. The syntax for dynamically change web pages title by using javascript. document.title="Welcome to Tech Dasher" This can used for chat, email notification, tab changes.

Javascript convert numbers to words

Tech Dasher

Javascript function for converting numbers to words. If your input is 123456 it will convert "One Lakh Twenty Three Thousand Four Hundred and Fifty Six". function convertNumberToWords(amount){     var words = new Array();     words[0]=''; words[1]='One'; words[2]='Two'; words[3]='Three';   words[4]='Four';  words[5]='Five'; words[6]='Six'; words[7]='Seven'; words[8]='Eight'; words[9]='Nine'; words[10]='Ten'; words[11]='Eleven'; words[12]='Twelve'; words[13]='Thirteen'; words[14]='Fourteen'; words[15]='Fifteen'; words[16]='Sixteen'; words[17]='Seventeen'; words[18]='Eighteen'; words[19]='Nineteen'; words[20]='Twenty'; words[30]='Thirty';

Top