Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top