How to check if user is on handheld device (mobile/tablet) using JavaScript

Just Paste the code below and call isHandheldDevice() when you would like to know. True would mean the user is on a mobile or tablet.

<script>
function isHandheldDevice() {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))
return true;

return false;
}
</script>

Image Not Found Solution

It is very annoying when missing images are shown as the default broken image as it is first of all, ugly, and secondly sometimes destorts the height/width of your content. This is a very quick and easy solution:

<img src=”myImage.jpg” onerror=”this.src=’no-image-found.jpg’;” alt=”My Image”/>

Could not load file or assembly ‘ChilkatDotNet2′ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Recently, we needed to migrate an old service which used Chilkat components to a new server. Even though all files were identical, the service kept on throwing the same error over and over:

Could not load file or assembly ‘ChilkatDotNet2′ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Imediately, I thought of the .NET version or the dll bit version. I first checked that the application pool was running with the same old .NET version which it was. So next step was to check the dll bit version since considering this was not a new application, the dll’s were using 32-bit. To check/change what bit version the application is running on, I had to follow the following steps:

  • Open the IIS
  • Open Application pool and select the application trying to run
  • Rigth Click – Advanced Settings
  • Set “Enable 32-bit Applications” to true

This solved the issue!