Passing Variables Inside window.open for JavaScript?

Here is the code I currently have :) Most of which works great..

<script type="text/javascript">
var mySideRes = screen.width*.2

function WindowOpen(url)
{
window.open(url, "sideBar", "width='mySideRes', height=200, resizable=yes, scrollbars=no, status=no");

}
</script>

...

Checking this <a href="#" onClick="WindowOpen('sidebar.php');">
Sidebar</a>


So as you see, it will open up a window however the variable for 20% of the current browser width will not pass through it keeps opening up in 100%, I also will try to make a variable for 100% of the current height and try to pass that through if i can get this working

Thanks! Shawn

2010-02-22T18:32:20Z

Jeremy my man! You are awesome, I cant believe i forgot something that simple! :)

A++!

2010-02-22T18:32:21Z

Jeremy my man! You are awesome, I cant believe i forgot something that simple! :)

A++!

Jeremy2010-02-22T18:28:59Z

Favorite Answer

Try this:

window.open(url, "sideBar", "width=" + mySideRes + ", height=200, resizable=yes, scrollbars=no, status=no");

?2016-11-09T01:20:46Z

you're calling alert_math1() with 2 parameters: javascript:alert_math1(x,y) yet those parameters are on no account exceeded into alert_math(): alert("the form is " + alert_math(z)); in case you regulate the z parameter to x, y interior the line above i think of of you will come across your code executes as expected (0: