CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Active Server Pages error 'ASP 0138' Nested Script Block A script block cannot be placed inside another script block

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    165
  • Date Created
    Wednesday, January 18, 2012
  • This Article Has been Viewed
    4590 times
  • Short Desc
    When you nest JavaScript tags within preexisted JavaScript tags, within ASP Classic, you will receive the following error.
  • Details
    If you try to nest a <script></script> inside of an existing <script></script> tag, you will receive the following error.

     
    Active Server Pages error 'ASP 0138'
    Nested Script Block
    /Replace.asp, line 238
    A script block cannot be placed inside another script block.

  • Recreate Issue
    To recreate this issue.

    <script>something here
    <%
    response.write"<script>Another Code Here</script>"
    %>

    </script>

    This will give you the error of a Nested Script Block
  • Resolve Issue
    To resolve this issue.

    <script>something here
    <%
    response.write"<Scr"&"ipt>Another Code Here</Scr"&"ipt>"
    %>

    </script>

    This will allow the script to run and render properly.