views:

63

answers:

2

I am trying to get this code to work, but it keeps failing. try this link.. http://tinyurl.com/ye5khug enter Edmonton, click on icon, then on "web site".

<script>
  function newPop(url, myWin, width, height, left, top, scrollbars) {
   parms = 'toolbar=yes, scrollbars=no, location=no,  menubar=no, resizable=no, width= ' + width  + ' , height=' + height + ' , left= ' + left   + ' , top= ' + top  + ' , titlebar=no , scrollbars = ' +  scrollbars ; 
   var newwin = window.open(url,myWin, parms); 
   newwin.resizeTo(width,height); 
   newwin.moveTo(0,0);
   newwin.moveTo(left,top);
   newwin.focus();
   return false;
  }


 </script>   

 <a onclick=" return newPop('http://google.com','window', '800','800','100','0','yes')" href="#">Web Site</a>
+3  A: 

You need to remove all of the white-space from the parms string.

e.g. :

parms = 'toolbar=yes,scrollbars=no,location=no,menubar=no,resizable=no,width=' + width  + ',height=' + height + ',left=' + left   + ',top=' + top  + ',titlebar=no,scrollbars=' +  scrollbars;

From the MDC:

This string parameter must not contain any blank space. Each requested window feature must be separated by a comma inside the character string.

Prestaul
A: 

problem was function was not in scope.

harry_T