|
|
|
One of the major headache to newbie web designers is the requirement of IE and Opera to activate ActiveX controls and plugins before they can be used. I was also facing this problem. But recently I have found out that the problem cab be avoided if we embed the control using an external JavaScript file. So what I have done is wrote a function to loop through my page contents and search for these controls. On finding them, replace the content with the same content using javascript. This function can be called on page load (or directly below the html code for the plugin) and now the controls need no more activation.
Save this function as activate.js and include it in your html file
| function activateControls(){
if (document.getElementsByTagName && document.body.outerHTML) {
var tag, arTag = Array('object','embed','applet');
for(tag in arTag) {
var arEl = document.getElementsByTagName(arTag[tag]);
for(var i = 0; i < arEl.length; i++) {
var el = arEl.item(i);
var params = el.getElementsByTagName('param');
var html = '';
if (params.length && !/<param/i.test(el.innerHTML))
for (var x=0;x < params.length;x++)html += params.item(x).outerHTML;
el.outerHTML = el.outerHTML.replace('>', '>' + html);
}
}
}
} | |
Call the function on page load. Alternately you can call the function directly below the html code for the plugin : window.onload = activateControls; |
|
| MD5 secured login Categories : PHP, Java Script, Authentication, Security | | | Flash Detection Script with loads of features Categories : Java Script, Flash | | | A damaged image generator (class) for validating text.
CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart Categories : PHP, PHP Classes, Security, GD image library, Security | | | Classic guest book made with PHP and Flash Categories : PHP, Flash, Java Script | | | Prevent Right Mouse steal your graphics Categories : HTML, Java Script, Security | | | complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password.
improved security using time functions to initialize random number generator. Categories : Java Script, HTML, Security, Authentication, Strings | | | Password using php, Javascript, and html form Categories : Security, PHP, Authentication, Java Script | | | Install Flash player plug-in Categories : Flash, Java Script | | | A PHP function to encrypt and decrypt a number or string or a combination of the two. Categories : PHP, Encryption, Security | | | Zephyr: AJAX Based Framework for PHP5 Developers Categories : PHP, AJAX, Frameworks, Java Script, Web Applications | | | Dollar Serial Number Validator Categories : PHP, Security, Algorithms | | | javascript doesn't accept a fieldname with [] Categories : Java Script | | | Array values from javascript to php Categories : PHP, Java Script, Arrays | | | Create HTML forms dynamicly using Javascript & PHP Categories : PHP, PHP Classes, Java Script | | | Linked comboboxes with php-mysql & javascript Categories : PHP, Java Script, Databases, MySQL | |
|
|
|