KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

Best books about Javasript

javascript, javascript detect chinese input formSometines when we write Javascript, we need color in #RRGGBB format. But we can not gurantee color input is in #RRGGBB format. For example, Red, rgb(255,0,0), #333 etc are all legal color format. Some color value input like 333333 without #. Or, any string value could be input as color. How could we convert these colors to #RRGGBB format?

javascript, javascript detect chinese input formHow to do it?

You need the following Javascript to convert color to #RRGGBB format

function parseColor(vValue) {
  var oColorParser = document.createElement("body");
  oColorParser.bgColor = vValue;
  return oColorParser.bgColor;

Of course, we can not expect the above function coould do every convert correctly. Only the kind of color like Red and 333333 could be converted into #RRGGBB correctly, for the other input, different browser could give different results.




Best books about ASP & ASP.Net from Amazon
JavaScript Bible, Fifth Edition (Paperback) JavaScript & DHTML Cookbook (Paperback) JavaScript: The Definitive Guide (Paperback) Beginning JavaScript Second Edition (Paperback) JavaScript: The Complete Reference, Second Edition (Paperback)


Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © All rights reserved(new). Privacy|Copyright
designed by

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer