morpheus3g
asked on
javascript error
when i click on a link that call a simple function to open a popup
mozilla javascript console returns me the following error:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://test.technews.it/?access=admin&module=news :: phPopup :: line 129" data: no]
the popup function is
function phPopup(url,w,h,wl,wt)
{
window.name = 'phusion_main'; window.open(url ,'phusion_popup','toolbar= 0,scrollba rs=1,locat ion=0,stat usbar=0,me nubar=0,re sizable=1, width='+w+ ',height=' +h+',left = wl,top = wt');
}
and is called as the following: phPopup('test.htm')
what's going wrong ?
mozilla javascript console returns me the following error:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://test.technews.it/?access=admin&module=news :: phPopup :: line 129" data: no]
the popup function is
function phPopup(url,w,h,wl,wt)
{
window.name = 'phusion_main'; window.open(url ,'phusion_popup','toolbar=
}
and is called as the following: phPopup('test.htm')
what's going wrong ?
ASKER
same error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>> window.name = 'phusion_main';
I can not get why do you have this line?
try delete it.
I can not get why do you have this line?
try delete it.
Check this:
<script>
function phPopup(url,w,h,wl,wt){
window.name = 'phusion_main';
if(!w){
w=400;
h=300;
wl=10;
wt=10;
}
window.open(url ,'phusion_popup','scrollba rs=1,resiz able=1,wid th='+w+',h eight='+h+ ',left='+w l+',top='+ wt);
}
phPopup('test.htm')
</script>
@my buddy devic: window.name is for use in the popup. After reloading the popup, for example by submitting a form in popup, is the opener reference destroyed, and can be regained by opener window name string.
<script>
function phPopup(url,w,h,wl,wt){
window.name = 'phusion_main';
if(!w){
w=400;
h=300;
wl=10;
wt=10;
}
window.open(url ,'phusion_popup','scrollba
}
phPopup('test.htm')
</script>
@my buddy devic: window.name is for use in the popup. After reloading the popup, for example by submitting a form in popup, is the opener reference destroyed, and can be regained by opener window name string.
hey Zvonko ;)
ach sorry I didn't see that 'phusion_main' != 'phusion_popup'
I thougth is the same name ;)
ach sorry I didn't see that 'phusion_main' != 'phusion_popup'
I thougth is the same name ;)
ASKER
it was a my fault..
sorry :)
sorry :)
ASKER
the question can be closed.. it was a fault of mine :)
Perhaps?
Cd&