Actually, there is something wrong, as Choopernickle pointed out.
The open(); method of the Window object takes four optional arguments.
The first argument is the URL of the page to be displayed in the new window.
The second argument is the name of the window.
The third argument is a list of features that specify the window size and GUI decorations.
The fourth is a boolean value that specifies whether the URL specified as the first argument should replace the current entry in the window's browsing history, or create a new entry. This is only useful if the second argument names a window that already exists.
Basically: you have incorrectly split up the third argument (list of features) into two separate arguments. Remove the apostrphes (') as Choopernickle said, and you'll be good to go.
In other words, this:
code:--------------------------------------------------------------------------------<script language="javascript">
function popUp(url)
{
window. open(url,'new_win','height=180,width=200','scrollb
ries=no')
}
</script>--------------------------------------------------------------------------------
Should be this:
code:--------------------------------------------------------------------------------<script language="javascript">
function popUp(url)
{
window. open(url,'new_win','height=180,width=200,scrollbar
s=yes,toolbar=no,resizable=no,menubar=no,directori
es=no')
}
</script>--------------------------------------------------------------------------------
With no line breaks.
HTH,
Nope, still doesnt work. The problem with the orginal was it worked in IE but not mozilla. That code doesnt work in either. This is what I'm using to call the script:
As Basscyst pointed out.
The previously posted script does work but the forum software is breaking the script by adding line breaks because the window.open(...) string is too long.
Try this:
Code:
<script type="text/javascript">
function popUp(url){
features = 'height=180,width=200,';
features+= 'scrollbars=yes,toolbar=no,';
features+= 'resizable=no,menubar=no,';
features+= 'directories=no';
window.open(url,'new_win',features)
}
</script>
<a href="http://google.com" onclick="popUp(href);return false">Google</a>
I think I should know that it needs to be on one line C'mon, Ive been a programmer of 5 languages for years. I got this thing worked out now. Thanks Ya'll