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

  • 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:
    127
  • Date Created
    Wednesday, March 30, 2011
  • Last Updated
    Wednesday, March 30, 2011
  • This Article Has been Viewed
    4711 times
  • Short Desc
    When you write your scripts, you may sometimes bundle them together and this may cause your script tags to become nested which is not allowed.
  • Details
    When you write your scripts, you may sometimes list them all in a single page to better handle them. This can cause some issues especially if you forget and leave a beginning and ending script tag, this will cause the following error,

     
    Active Server Pages error 'ASP 0138'
    Nested Script Block
    /Functions.asp, line 23
    A script block cannot be placed inside another script block.
  • Recreate Issue
    To recreate this issue:

    <script>
    your code here #1
    <script
    your code here #2
    </script>
    </script>


    As you can see above, we have a nested script #2, this is not allowed and will cause the error.
  • Resolve Issue
    To resolve this issue:

    <script>
    your code here #1
    // Add additional scripts below each
    your code here #2
    // Add additional scripts below each
    your code here #3
    // Add additional scripts below each
    your code here #4
    </script>


    As you can see, we have our beginning and ending script tags.
    We are also listing several different scripts within the tags, this is allowed and can make your code more readable and also for faster loading of the scripts.