(c) 2016, Deluxe-Menu.com
Search  
Ctrl+F2 - enter/switch menu | Arrow keys - navigate | Esc - exit menu  
  Support
  FAQ
  Contacts
  About Us
  Recent Questions


 

    I created a custom error page for a site, but the Menu JavaScript would not display.

Return to Recent Questions


Q: I created a custom error page for a site, but the menu would not display.

I found that this was due to the erroneous "current directory" in the bad link test, for a non-existent directory.

which is: level2/level3/

I changed the script code from:
<script type="text/javascript">var dmWorkPath = "DMworkfiles/";</script>
<script type="text/javascript" src="DMworkfiles/dmenu.js"></script>

to:

<script type="text/javascript">var dmWorkPath = "DMworkfiles/";</script>
<script type="text/javascript" src="/DMworkfiles/dmenu.js"></script>

adding the "/" before "DMworkfiles/dmenu.js" source reference allowed the .js file to be found in the root directory and the menu would display.

The problem is that the little menu "expansion" arrow .gif cannot be found in the "current working directory" of level2/level3/. just little "blanks" show.

I tried changing:
var dmWorkPath = "DMworkfiles/";

to:
var dmWorkPath = "/DMworkfiles/";

but that did not enable the display of the arrows.

I also had to prefix all of the links in the menu with a "/" to indicate the root directory because of the "current directory" for the bad page.

I hope I have explained the problem sufficiently.
What am I doing wrong or missing here?


A: You can use additional parameters to make menu paths absolute:

var pathPrefix_img = "http://domain.com/images/";
var pathPrefix_link = "http://domain.com/pages/";

These parameters allow to make images and links paths absolute.
For example:

var pathPrefix_img = "http://domain.com/images/";
var pathPrefix_link = "http://domain.com/pages/";

var menuItems = [
["text", "index.html", "icon1.gif", "icon2.gif"],
];

So, link path will be look so:
http://domain.com/pages/index.html

Images paths will be look so:
http://domain.com/images/icon1.gif
http://domain.com/images/icon2.gif

Please, try to use these parameters





Return to Recent Questions

Top Mindblowing HTML Image Slideshow Ideas Bootstrap Table Template  |  Best 18 Landing Page Bootstrap Theme Roundup  |  Free and Easy Website Builder  |  40+ Free Bootstrap Templates 2021  |  Offline Mobile Website Builder Software  | 
Copyright (c) 2019, Deluxe-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Terms of Use  |  Write Us
All rights reserved. AI Website Builder | AI Website Generator | Free AI Website Generator | AI Website Generator | AI web page design generator