views:

190

answers:

3

When we use getelementbyid in JS the browser ask to allow or block the script, is there a piece of script to automatically allow that or avoid that or is there an alternative for that

A: 

I really doubt that document.getElementById("id") will be blocked in a browser. It must be something else causing this.

Philipe Fatio
i was trying to get ID of a text box and change its attributes
Junaid Saeed
A: 

presumably this is the ActiveX alert in IE? Can you confirm exactly what error in what browser and what code you are using - even a snippet should help

seengee
+2  A: 

If "the browser" is IE and you are viewing the file locally, this is because IE blocks JavaScript by default in local HTML as a security measure.

If "the browser" is Firefox (very unlikely), this is because netscape.security.PrivilegeManager.enablePrivilege was called. Never call that function.

Eli Grey