|
|
The drop down menu buttons have a problem with newlines.
Return to Recent Questions
Q:
The menu has a problem with newlines. The menu builds correctly
(layout ok) but when pressed on the button nothing happens
At some point, in the DHTML menu, we have the following in the javascript:
var menuitems = [
["|Print HTML","javascript:alert('HTML print: Only the 7 most
recent orders on the screen \n will be printed because of space
limitations on paper.');printResult('4'); ","","", ,"_parent",,]
]
As you can see we have a newline (\n) between the words "screen"
and "will". But when we click on the button nothing happens. If we
remove the newline and we click on the button then we first get the
alert box. After pressing the OK button the function printResult is
called.
Is there any way for us to still use the newline character in the menuItems variable?
This can be easily reproducible. That's why I haven't made an example.
A:
Try to write in the following way \\n:
["|Print HTML","javascript:alert('HTML print: Only the 7 most
recent orders on the screen \\n will be printed because of space
limitations on paper.');printResult('4'); ","","", ,"_parent",,]
Return to Recent Questions
Related:
- Sep 02, 2006 - Little vertical spacers between menu items in the drop down menu.
- Sep 06, 2006 - The alighment of the dropdown menu is off to the right in Firefox...
- Sep 06, 2006 - The first item of the html drop down menu stays highlighted.
- Sep 11, 2006 - How can I hide my dropdown menu on print?
- Sep 11, 2006 - If I use doctype the settings of the submenus in javascript dropdown menu get lost.
- Sep 23, 2006 - Is it possible that javascript drop down menus doesn't put anything on the local computer?
- Sep 26, 2006 - Firefox doesn't support the dropshadow and effects in the javascript pull down menu.
- Sep 26, 2006 - Is there a way to change the height of the main buttons in my simple dhtml menu.
- Sep 29, 2006 - Is it possible to use an external file in the java drop down menu?
- Oct 01, 2006 - All of the items in html pull down menu are different sizes.
- Oct 01, 2006 - When I click on link of my vertical drop down menu no file is loaded!?
|