JavaScript Not Working in Firefox

Are you trying to open an URL using the JavaScript method but it is not working in the Firefox browser? Then you can use the below simple trick to resolve this issue.

The issue happens in the Mozilla Firefox browser because it is expecting a return value from the JavaScript function which is not being returned. So it shows the [object window] message in the previous tab from which the new tab is being opened using the function.

To solve this issue, use void() function over function. Below is an example:

void('', '_blank'));

If using javascript: keyword, like most we do in Oracle Apex, then check the below example:

javascript:void('', '_blank'));

Written by Vinish Kapoor

An Oracle Apex Consultant, Oracle ACE, and founder of and a question and answer forum for developers. You can connect with me on Facebook and Twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *