We help IT Professionals succeed at work.

Hoist the colors! We’ve added location flags to usernames sitewide, so it's easier to connect with the global community on EE. View My Profile

x

Classic ASP Nested Script Block error

Stefan Motz
Stefan Motz asked
on
1,585 Views
Last Modified: 2014-06-30
Hi Experts,
I'm trying to use tinymce text editor on my Classic ASP page but I get the following error:

Active Server Pages error 'ASP 0138'
Nested Script Block
/SOC/tinymce/0.asp, line 5
A script block cannot be placed inside another script block.

This is my code:
<html>
<head>
<script type="text/javascript" src="/SOC/EPS/tinymce/js/tinymce/tinymce.min.js" ></script >
<script type="text/javascript">
tinymce.init({
    selector: "textarea",
	theme : "advanced",
	force_br_newlines : false,
	force_p_newlines : false,
    forced_root_block : '',
    theme: "modern",
    plugins: "image, link, print",
    height: 300,
                    toolbar: "styleselect| undo redo | removeformat | bold italic underline |  aligncenter alignjustify  | bullist numlist outdent indent | link | print | fontselect fontsizeselect",
                    menubar: false,
                    statusbar: false,
                    resize: true

                }
            );
</script>
</head>
<body>
        <textarea name="Message"></textarea>
</body>
</html>

Open in new window


How can this error be prevented. Thank you for your help
Comment
Watch Question

Web Ninja at large
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Big MontyWeb Ninja at large
CERTIFIED EXPERT

Commented:
yep, that was it, i just tested on my own server
Stefan MotzIT Developer

Author

Commented:
Thank you so much, this solved the problem.
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
In addition, you had "theme" twice and it should only be there once.  The page was not validating even with removing the space.  You are going to want to add the doctype and maybe you left that out just for this illustration.    When you run into issues like this without asp code, use the validator http://validator.w3.org/ because this is not really an asp issue.  

<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript" src="/SOC/EPS/tinymce/js/tinymce/tinymce.min.js" ></script>
  <script type="text/javascript">
tinymce.init({
    selector: "textarea",
	theme : "advanced",
	force_br_newlines : false,
	force_p_newlines : false,
    forced_root_block : '',
    
    plugins: "image, link, print",
    height: 300,
                    toolbar: "styleselect| undo redo | removeformat | bold italic underline |  aligncenter alignjustify  | bullist numlist outdent indent | link | print | fontselect fontsizeselect",
                    menubar: false,
                    statusbar: false,
                    resize: true

                }
            );
</script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <textarea name="Message"></textarea>
</body>
</html>

Open in new window

Stefan MotzIT Developer

Author

Commented:
Thank you Padas. I thought it was an ASP issue because when I saved the page with an .htm extension I didn't get an error message.
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
I know, you have to be a bit more sleuthy when checking for front end errors.   You didn't have any asp code so it couldn't have been asp/vb.     The page had several errors including the space.  Just make sure you take care of those other 2 items (doctype and only setting one value for "theme").  There was another issue that was being thrown by the validator and I don't know what it was.  When I retyped the code by hand it validated.   That is the code that I posted.

Best of luck!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.