Category

Javascript

The Pirate Bay is mining cryptocurrency with visitor’s CPU

It has been discovered that torrent site The Pirate Bay has been operating a cryptocurrency miner. The site’s visitors learned that The Pirate Bay exploits a user’s CPU to mine Monero digital coins, through JavaScript code found on the torrent site.   When users browsed specific pages on The Pirate Bay, they found a significant increase…

Remove Carriage Return, Line Feed, Tab in TSQL

Having problem when I try to display the message that retrieved from database with the line break. When I try to manipulate the message using javascript, I keep getting the message of unterminated string javascript error message. tech.david-cheong.com Try to google for the alternative to remove the line break getting from DB,…

Javascript to disable right cilck on web site

Just come across with my company SQA team where they request us to do the disable right click features on our front end web site. The initial javascript which exists in our script only work with Microsoft Internet Explorer but not Firefox. So Google around and found the following javascript…

Possible injection use keyword

All the web developer, web admin, as well as DB admin are always facing the attacking from all around the world toward their web site, but how to prevent it? Some may use the 3th party software to prevent it, some may just filter all the possible keyword enter by…

Form validation not allow chinese cheractor

the following example use the javascript regular express to validate the value where Chinese charecter is not allow. <script   language=javascript>           function   checkChinese(){               var   re   =   /[u4E00-u9FA0]+/;               if   (re.test(form1.tjiccode.value))…

URL Hidden Tricks to check page's last update

Check the page’s last update date Go to any web site as you like Delete the content in the URL address bar Enter the following script javascript:alert(document.lastModified) Press Enter This code will display any web page’s last update including the specific time, so by using the this script, you will…

Attaching event in both MSIE and FF with Javascript

Most of the developer who working in MS platform will be used to the javascript window.attachEvent. But maybe some of you don’t know that window.attachEvent is only working on IE7+ and Opera only. Your coding will hit an javascrpit error when running at IE 6 or any version of firefox.…

Disabled certain key to be entered using javascript

There is always the good way to prevent and verify the using enter data, especially for each text box or text area. The following is script use the event object to check on the key code that the user enter, return false to prevent user to enter. Disabled space to…