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 ?
LVL 2
morpheus3gAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Perhaps?

Cd&
morpheus3gAuthor Commented:
same error
GwynforWebCommented:
this works fine in IE and FireFox and

<script>
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');
}

// phPopup('http://google.com',300,300,10,10)
 phPopup('http://google.com')
</script>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

devicCommented:
>>> window.name = 'phusion_main';

I can not get why do you have this line?
try delete it.
ZvonkoSystems architectCommented:
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.

devicCommented:
hey Zvonko ;)

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

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

sorry :)
morpheus3gAuthor Commented:
the question can be closed.. it was a fault of mine :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.