kaz Posted March 2, 2005 Share Posted March 2, 2005 ><script type="text/javascript"> <!-- function OpenvBChat(){ vBChat = window.open('vBChat.php?$session[sessionurl]','vBChat','directories=no,height='400',width='600',location=no,menubar=no,scrollbars=yes,status=no,toolbar=no') return false; } --> </script> <!---- start HTML Link-----> <a href="vBChat.php?$session[sessionurl]" onclick="return OpenvBChat();">Chat Room</a> It wont open it in a new window with the new sizes (width and height specified) it acts like a normal link and shows that java error, quite frankly i find it really damn annoying can someone help before i swear -kaz Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted March 2, 2005 Share Posted March 2, 2005 (edited) I believe the problem is that you've quoted the height and width attributes and they should not be. The window.open method takes three arguments - the URL to open, the name of the window, and a single string describing the features of the new window to open. The quotes you have around the height and width prevent the javascript from seeing the feature list as a single string. I think your code should corrected like this: >vBChat = window.open('vBChat.php?$session[sessionurl]','vBChat', 'directories=no,height=400,width=600,location=no,menubar=no,scrollbars=yes,status= o,toolbar=no'); Give it a shot and see if it makes your script works any better. Update: For some reason, the board is insisting on escaping one of the quotes, even though it is inside of a set of CODE tags. Where you see & #39; in the function above, that should also be a ' mark. Edited March 2, 2005 by TCH-David Quote Link to comment Share on other sites More sharing options...
matman Posted March 2, 2005 Share Posted March 2, 2005 Kaz, remember that the ' or "single quote mark" signifies the beginning and end of a string in JavaScript. So when you type this: >'directories=no,height='400',width='600',location=no,menubar=no,scrollbars=yes,status=no,toolbar=no' Javascript sees: >'directories=no,height=' as one string, >',width=' as another, and >',location=no,menubar=no,scrollbars=yes,status=no,toolbar=no' as another, with some non-string values in between. Quote Link to comment Share on other sites More sharing options...
kaz Posted March 3, 2005 Author Share Posted March 3, 2005 So basically make it all with " that quotes Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted March 3, 2005 Share Posted March 3, 2005 You need to remove the quotes you have on the height and width. It doesn't matter if it's a single or double quote - neither are supposed to be there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.