Link to home
Start Free TrialLog in
Avatar of morpheus3g
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,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+w+',height='+h+',left = wl,top = wt');
}


and is called as the following: phPopup('test.htm')

what's going wrong ?
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

left = '+wl+',top = '+wt

Perhaps?

Cd&
Avatar of morpheus3g
morpheus3g

ASKER

same error
ASKER CERTIFIED SOLUTION
Avatar of GwynforWeb
GwynforWeb
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of devic
>>> window.name = 'phusion_main';

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','scrollbars=1,resizable=1,width='+w+',height='+h+',left='+wl+',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.

hey Zvonko ;)

ach sorry I didn't see that 'phusion_main' != 'phusion_popup'

I thougth is the same name ;)
it was a my fault..

sorry :)
the question can be closed.. it was a fault of mine :)