Basic Tutorials.Ch4. removing menus from a page

When you remove a menu bar from a web page.. it’s important to also remove the ‘script’ that makes the menu run.. if the script is left in place without a menu for it to work with your web browser will throw out a ‘javascript error’. Here’s a quick video to explain….

To remove the script.. just remove this line of code when you remove the menu

If you don’t remove the script.your web page will throw out a javascript error.. and other javascript components on the page might stop working, or working correctly.

You’ll need to first determine if you do have a javascript error, then correct it.

To determine if your page is throwing a script error.. open your page in Firefox.. not any other browser, use Firefox for testing script errors. If you are not testing your pages with Firefox.. now is the time to start..

Once you’ve previewed or opened your page in Firefox, click on the ‘Tools’ menu up top, then click on the ‘Error Console’ link.. as in this example

If you see an error and it’s with the menu script.. you’ll something very similar to the error message as noted in the above example..

To correct this error,

  1. open the page from which you’ve removed your menu
  2. find this code
  3. and delete the intire line of script.. which would look like this

<script type=”text/javascript”>ddsmoothmenu.init({mainmenuid: “smoothmenu2”, orientation: ‘v’, classname: ‘ddsmoothmenu-v’, contentsource: “markup” })</script>

Preview your page once removed.

Click on the Error Console in Firefox.. and this time.. press the ‘Clear’ option first.

Close the Error Console.. refresh the page in Firefox.. and retest to make sure the error has been corrected….

This entry was posted in Chapter 4: Top Side Menu Components and tagged , , , . Bookmark the permalink.

Comments are closed.