I am using top.window.close() to close the parent window but it is not working in Mozilla firefox.Please suggest alternatives. The above code is working fine for IE6.
If you are using firefox profile you will be able to achieve it. Once it is updated in the firefox profile, it allows the firefox to be closed which is opened using the same profile.
echo 'user_pref("dom.allow_scripts_to_close_windows", true);' >> $MOZILLA_PROFILE_DIR/prefs.js
It works also if you add it in the user.js(Need to create this in the firefox profile directory).
touch $MOZILLA_PROFILE_DIR/user.js
echo 'user_pref("dom.allow_scripts_to_close_windows", true);' >> $MOZILLA_PROFILE_DIR/user.js
And then start your firefox using the profile. You will be able to close the window by using javascript
window.close()
Remember: Without this you can't close the window which you have not opened using window.open()