Feb 2009
05
09:36am

I’ll make this short and quick. I’ve been searching the web for a Javascript sleep function that works and came across this. It was presented as a class but what I needed was just a function so I rewrote the code a bit. Here’s the end result of my Javascript sleep function which I named, well, jsleep. Read the rest of this entry »


Share this Post through Social Bookmarking
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • YahooMyWeb
Nov 2008
17
03:48am

Web designers out there! Have you ever wanted to have rounded corners on the web pages you design but without the use of ugly GIFs or IE-troublesome PNGs? I’ve got good news for you and it’s called jQuery Corners. Have a look at the screenshot below:

Read the rest of this entry »

Share this Post through Social Bookmarking
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • YahooMyWeb

PNG images are more often better than GIF when it comes to rendering images with transparency mainly because GIF can only support 256 colors while PNG can support 32-bit colors. Here’s a graphical comparison between the two.

Read the rest of this entry »

Share this Post through Social Bookmarking
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • YahooMyWeb
Mar 2008
22
09:55am

As promised, here’s a sample implementation of the Google Translate API.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Google Translate</title>
<script language="javascript" src="http://www.google.com/jsapi"></script>
<script language="javascript">
 google.load ("language", "1");
 function gtrans (f) {
  document.getElementById("translation").innerHTML = "-";
  var lang = f.langpair.value.split("|");
  google.language.translate (f.translate.value, lang[0], lang[1], function (result) {
   if (!result.error) {
    var container = document.getElementById("translation").innerHTML = result.translation;
   }
  });
  return false;
 }
</script>
</head>
<body>
<form onsubmit="return false">
 <p>Enter text to translate and click "Translate"</p>
 <textarea name="translate" cols="50" rows="5"></textarea>
 <br />
 <select name="langpair">
  <option value="ar|en">Arabic to English</option>
  <option value="zh|en">Chinese to English</option>
  <option value="zh-CN|zh-TW">Chinese (Simplified to Traditional)</option>
  <option value="zh-TW|zh-CN">Chinese (Traditional to Simplified)</option>
  <option value="nl|en">Dutch to English</option>
  <option value="en|ar">English to Arabic</option>
  <option value="en|zh-CN">English to Chinese (Simplified)</option>
  <option value="en|zh-TW">English to Chinese (Traditional)</option>
  <option value="en|nl">English to Dutch</option>
  <option value="en|fr">English to French</option>
  <option value="en|de">English to German</option>
  <option value="en|el">English to Greek</option>
  <option value="en|it">English to Italian</option>
  <option value="en|ja">English to Japanese</option>
  <option value="en|ko">English to Korean</option>
  <option value="en|pt">English to Portuguese</option>
  <option value="en|ru">English to Russian</option>
  <option value="en|es">English to Spanish</option>
  <option value="fr|en">French to English</option>
  <option value="fr|de">French to German</option>
  <option value="de|en">German to English</option>
  <option value="de|fr">German to French</option>
  <option value="el|en">Greek to English</option>
  <option value="it|en">Italian to English</option>
  <option value="ja|en">Japanese to English</option>
  <option value="ko|en">Korean to English</option>
  <option value="pt|en">Portuguese to English</option>
  <option value="ru|en">Russian to English</option>
  <option value="es|en">Spanish to English</option>
 </select>
 <input type="button" value="Translate" onclick="gtrans(this.form)" />
 <p id="translation" style="border:1px solid #00f;padding:5px;width:400px">-</p>
</form>
</body>
</html>

Read the rest of this entry »

Share this Post through Social Bookmarking
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • YahooMyWeb
Mar 2008
21
10:41am

If you need to translate your website from one language to another then I have some good news for you. Google Translate has released a JavaScript based API that’s both easy to use and implement. It can handle 13 different languages and as much as 29 language pairs.

Read the rest of this entry »

Share this Post through Social Bookmarking
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • YahooMyWeb
Mar 2008
17
09:13pm

Form input validation is sometimes an annoying part in web development but it’s something that we web developers can’t avoid. In order to make sure that the data being entered by our users are valid, we simply have to validate. Another good use of validation is to provide feedback to the user on whether what they are typing is acceptable or not.

Read the rest of this entry »

Share this Post through Social Bookmarking
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • YahooMyWeb

AJAX Introduction

Posted by Mike Lopez under Javascript/AJAX
2 Comments
Mar 2008
17
08:25pm

Ever wondered what AJAX is? AJAX stands for Asynchronous JavaScript and XML. It is not a programming language in itself but rather a combination of different web development techniques. Furthermore, AJAX technology is not new though it has only been popularized recently especially by Google (Google Maps, GMail, Google Calendar, etc.)

Read the rest of this entry »

Share this Post through Social Bookmarking
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • YahooMyWeb