Javascript Create A Hyperlink Element

Creating a hyperlink element using Javascript is pretty simple. Do the following. Notice, that the hyperlink element contains two text ‘click me’ that’s been set twice. This is because IE only accepts its proprietary innerText property to set a hyperlink’s text while other browsers use textContent. To set a CSS class name, you need to use the className attribute because the class property is a reserved word in Javascript. You can either use it as element.classname = ‘class_name’ or element.setAttribute(’className’, ‘class_name’);

Internet Explorer 8 Beta’s Cookies

I never care about Internet Explorer. I never even knew there was a version 8 beta out. I only found out about it after my boss told me the owner installed it and our web applicatins got messed up (since he’s an IE user). So off I went to debug and find out why. Sigh, why in the first place did he have to install it when it’s just a beta version. I never use beta or evaluation softwares as I find them dirty hanging around in my desktop PC. More and more debugging until I finally found the culprit. The browser itself has cookies turned off. My web application couldn’t pop open a new window because… Continue reading

Javascript Copy Text To Clipboard

Issues arise when you want to copy text to the clipboard using javascript. Firefox provides a security measure which prevents you from doing it so a workaround has to be made for it to happen. I am using IE7 for my IE testing and in this version, it also has a security feature although less strict than Firefox. Whenever you browse to a new page that has a copy to clipboard function, a popup window prompts you asking if you want to allow the webpage to access your clipboard. Normally, you would choose no. But instances may require you to like if the site you are accessing is yours or related to your needs and you have… Continue reading