Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Current Version (Old)
 Include file causes nested script error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 14 June 2001 :  11:06:56  Show Profile
I have a whole lot of HTML and javascript which produce those good old drop down menu's we all love, and thought I would put it all in an include file so I dont have to edit every page when I want to change something, but on splitting the file (default.htm) into default.asp and BannerInclude.asp I getActive Server Pages error 'ASP 0138'

Nested Script Block
/TEST/NewGroupInternetsite/BannerInclude.asp, line 66
A script block cannot be placed inside another script block.

Line 66 is: document.write("<SCRIPT LANGUAGE='JavaScript1.2' SRC='!Scripts/Menu.js' TYPE='text/javascript'><\/SCRIPT>");

Why is the ASP engine bothered about the javascript and how do I get around this ?

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 14 June 2001 :  11:21:12  Show Profile  Visit HuwR's Homepage
since you are using a document.write, I am assuming it is in a <SCRIPT> tag, what it is saying therfore, is you can't write another <SCRIPT> tag since it would be enclosed by the one doing the writing.

Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 14 June 2001 :  12:55:14  Show Profile
I know I am being dumb, but I have not added any <script> tags since the doc was one HTML file with an htm extension, all I have done is split it into two files which both have asp extentions. In fact I have just gone back to the original htm version, changed the extension to asp and that gives the same error. Please help me understand why , I thought the ASP engine on the server only looked at code inside <% %> or <Script></Script> tags but obviously not.

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 14 June 2001 :  13:57:00  Show Profile  Visit HuwR's Homepage
it is difficult to explain without seeing the code you have, email me your files and I will try to explain what is wrong.

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 14 June 2001 :  18:09:48  Show Profile
document.write isn't available server-side, is it?

======
Doug G
======
Go to Top of Page

GBurch
Junior Member

United Kingdom
107 Posts

Posted - 15 June 2001 :  02:49:18  Show Profile
quote:

document.write isn't available server-side, is it?


no, it's response.write on the server side, even for plain old JavaScript.

http://www.captgb.dabsol.co.uk
http://www.slipstreamservices.com
Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 22 June 2001 :  03:25:09  Show Profile
Answering my own question, the answer is check the FAQ on the site where you got the javascript (WebReference/DHTML Diner in my case) as someone else has probably had the problem before you!!

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07