iam trying to open a child window with disabld toolbar in IE. Everytime i have to set the pop up blocker as off and ten work on it. can someone help with a piece of code to disable the pop up blocker using javascript for all IE versions.
The best way is to ask the user nicely to turn the blocker off, because you really need pop-ups. Some apps use this approach, but it is certainly not suitable for a public web service.
Instead of using javascript, first try using a simple target="_blank". Popup blockers will tend to disable JS rather than simple html.
a href="#" target="_blank"
If that doesn't work, you might want to consider something like the colorbox - http://colorpowered.com/colorbox/
This works in the same way as a popup, but doesn't bring up a new window.
... (You could just ask people told press ctrl+click when they click the link to your pop-up - that's the generic 'temporarily allow pop-ups' shortcut)
Rather than showing a traditional popup, consider showing an in-page popup instead. For example:
- If you just want to display an image at a larger size, use Lightbox.
- If you need something with more interactivity, use the dialog widget in jQuery UI.
- You might also want to consider one of these.
However, make sure you have a good reason to show the popup, using one to show ads will probably just annoy users.