Nested Script Block

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
websagogo
Beginner
Beginner
Posts: 1
Joined: Mon Nov 15, 2004 7:14 pm
Location: Dublin Ga
Contact:

Nested Script Block

Post by websagogo »

I am very new to javascript and DHTML. I have downloaded the menu for verticle nav menu ver 5.52. As per the install files I copied the js files to the root of my web and copied the Javascript code below into the head of a document which is on the root. I got an error on the web page which is below.

Original Code:
<script type="text/javascript" src="milonic_src.js"></script>

<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>
<script type="text/javascript" src="menu_data.js"></script>



Error:
Active Server Pages error 'ASP 0138'

Nested Script Block

/index.asp, line 18

A script block cannot be placed inside another script block.


If anyone has an answer it would be greatly appreciated.
David Taylor
NLAmerica
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Got a URL we can look at?

Also, the middle part of your call isn't quite right...

Code: Select all

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>");
John
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

I noticed a similar problem reported here back in September, and cured by Kevin3442:

http://milonic.com/mfa/2004-September/005013.html

John's reply is correct in that your middle part of the code is wrong, you have a <script> command starting inside an already open <script>. You have to break it up
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
Post Reply