Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Thursday February 8 2018 - 06:02:57

Embedding the dhtml code inside a table cell


Poster: naveedarif
Dated: Wednesday November 3 2004 - 18:47:54 GMT

I am having difficulty embedding the dhtml menu inside a cell (<td>) which is inside another cell. The following page which has the menu, needs to be called as an include from the main page.

Here is the url:
http://www.cair-net.org/includes/topnav ... mlexpt.asp


Also, the following code always break the website by giving the following error:

<script type="text/javascript">
if(ns4)_d.write("<script language=JavaScript src=mmenuns4.js><\/script>");
else _d.write("<script language=JavaScript src=mmenudom.js><\/script>");
</script>


Error Type:
Active Server Pages, ASP 0138 (0x80004005)
A script block cannot be placed inside another script block.
/includes/topnavigation.asp, line 4

Please help.

Re: Embedding the dhtml code inside a table cell


Poster: kevin3442
Dated: Wednesday November 3 2004 - 19:45:47 GMT

Hi,
naveedarif wrote:I am having difficulty embedding the dhtml menu inside a cell (<td>) which is inside another cell. The following page which has the menu, needs to be called as an include from the main page.

I'm a little unclear as to what kind of difficulty you're having. Can you be more specific please? What isn't working?

Also, the following code always break the website by giving the following error:

<script type="text/javascript">
if(ns4)_d.write("<script language=JavaScript src=mmenuns4.js><\/script>");
else _d.write("<script language=JavaScript src=mmenudom.js><\/script>");
</script>

Error Type:
Active Server Pages, ASP 0138 (0x80004005)
A script block cannot be placed inside another script block.
/includes/topnavigation.asp, line 4

See this post for a solution.

You should also update your menu code. You are using v5.04, but v5.51 is the current release. There have been many fixes and enhancements since v5.04.

Hope that helps,

Kevin


Poster: Maz
Dated: Wednesday November 3 2004 - 19:53:10 GMT

Is it because you are not hiding the script such as

<!--
-->

I don't see body tags on your example, if its xhtml you might need to use CDATA, should be an example in begginers section. To be sure you could validate the html and see what occurs.

However, I realize that includes can be tricky depending up your set up.

Maybe you need to include scripts directly, like include=script path. I've had includes that wouldn't work unless I wrote them as __at__ include=

This may be a bit out of my scope.

maz

Thanks...However, still searching for the answer...


Poster: naveedarif
Dated: Wednesday November 3 2004 - 21:05:07 GMT

Hi, thanks for your responses.
If I use the following code (with all the commenting etc), the menu does not appear in any web browswer:

<script type="text/javascript">
<!--
if(ns4)_d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=mmenuns4.js><\/SCR"+"IPT>");
else _d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=mmenudom.js><\/SCR"+"IPT>");
-->

Also, this 'topnavigation.asp' file really is just an include file to be called from the main page. That is why there are no body tags in this asp file. Why I put the references for the .js files in this one was in order to atleast test it since putting these references in the <head> or <body> tags in the main page and then calling include file was not working either.


Poster: kevin3442
Dated: Wednesday November 3 2004 - 23:11:47 GMT

Here is a working example using the same code to load the menu scripts in an .asp page. The exact code used to load the menu scripts on that page is:

Code: Select all

<script type="text/javascript" src="milonic_src.js"></script>
<script   type="text/javascript">
<!--
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
 -->
</script>
<script type="text/javascript" src="menu_data.js"></script>

This works for me. The only thing I might suggest is removing the comment tags, although I don't know why that would be a problem.

What browsers are you trying your page in? Can you post the .asp code for your test page (put it inside of BBCode "code" tags)?

Kevin