Articles
Tried to run internationalization in WAMP using php_intl module, but got error Unable to load dynamic library ‘c:/wamp/bin/php/php5.3.13/ext/php_intl.dll’. This makes me headache. It happens because Apache can’t find the icu*.dll files. There is at least 3 solutions:
- One solution is to add “C:\wamp\bin\php\php5.3.9” (or similar directory) to your system PATH.
- The other solution is to copy the icu*.dll files to your apache’s bin directory.
- A third option is to copy the icu*.dll files to your Windows system directory (system32 or SysWOW64)[……]
Read more
I created and added pre
element with contentEditable
attribute. I inserted some text with non-breaking space and tried to get text and split using simple txt.split(/\s/)
, where txt represent string from pre
element. Unfortunately, this split doesn’t work well in IE7 and return wrong splitted data in array when string contains non-breaking spaces.
I solved this problem by using little trick:
var temp = doc.createElement('div'),
str;
temp.innerHTML = txt;
str = temp.innerText || temp.textContent || temp.text;
temp = null;
a[……]
Read more
Have you ever tried to check what font is rendered on page? Probably yes. I found nice addon to Firefox Firebug named “FireFontFamily“. Cite from addon website:
Highlight the rendered font-family in Firebug
. Very usefull when working on font-face especially and I wanted to be sure what font is rendered.[……]
Read more
Have you ever tried to find out how to list all of ActiveX objects? Well, mee too. Now I found the solution by using small software named ActiveXHelper.
ActiveXHelper is a small utility that allows you to view essential information about ActiveX components installed on your computer. You can view the entire (and very large !) list of ActiveX components by loading it from HKEY_CLASSES_ROOT\CLSID Registry key, or alternatively, display only the ActiveX components that you specify. In addition, you can temporarily disable specific ActiveX compo[……]
Read more
Just started project named jsCode on GitHub some weeks ago. I’m not going to compete in the race to be the best framework. Re-invent the wheel simply to learn more. Preparing a simple page on jsCode, where you can create your own version of jsCode.
However, if you have a suggestions or a critical voice then just write a comment.[……]
Read more
Finally, there is a one, big table of CSS Compatibility and Internet Explorer available on Microsoft site.
However, it’s surprised me that there is much more information for web developers on Windows Internet Explorer API reference (Developer Center). Hm, seems look good.[……]
Read more
Well, this time will be shortly as always. I wanted to get value from some param in URL. After some research this could be done by this code (I use it):
/**
* Function getValueFromURLparam
* Extracting Querystring key/value pairs
*/
var getValueFromURLparam = function(name, url)
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^]*)";
var regex = new RegExp( regexS );
var results = regex.exec(url);
return (results === null) ? "" : results[1];
};
[……]
Read more
Some day I wanted to check if the string is valid of JSON format. After some research I found the solution:
/**
* Function isJSON
* Check if a string is JSON
*/
if(!String.prototype.isJSON)
{
String.prototype.isJSON = function()
{
return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,'')));
}
}
[……]
Read more
Sometimes in our JavaScript code we use bulit-in console
to view information, errors, etc. But when we close the Firebug then we see the JS errors. Why? Because there is no object window.console
. So, what to do? Just create console
object and create empty object for all console
methods.
My code, which I use:
/**
* Firebug console
* If not available then add empty method
*/
var isFirebug = false;
if(typeof window.console != 'undefined')
{
for (var obj in window.console)
{
if (typeof window.console[obj] != 'u[......]Read more
After some research I found the simple solution to convert HTML characters entities back to regular text using JavaScript. The code is simple and fast.
var decodeEntities = function( s )
{
var str, temp = document.createElement('p');
temp.innerHTML = s;
str = temp.textContent || temp.innerText;
temp = null;
return str;
};
[……]
Read more
Pagination