Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Uncaught ReferenceError: isc is not defined

    Hi Isomorphic,

    I have problem when trying to set FileLoader cacheISC(),


    1) first.jsp
    Code:
    <script type="text/javascript" language="javascript">var isomorphicDir = "fndongApp/sc/";</script>
    <script type="text/javascript" language="javascript" src="fndongApp/sc/modules/ISC_FileLoader.js"></script>
    <script> isc.FileLoader.cacheISC();</script>
    when run on the browser , check inspect console, the function 'isc.FileLoader.cacheISC()' is undefined.

    and I have check the code in ISC_FileLoader.js , it doesnt have this function cacheISC() , have only 'cacheISC:function(skin,modules,onload' with parameters

    'isc.FileLoader.cacheISC()' is undefined, and how to know we used the correct function?

    WARM Regards,
    FRANK
    Last edited by franko; 12 Jun 2020, 06:03.

    #2
    That line - "cacheISC:function(..." - is in fact the definition of the cacheISC method.

    Your results suggest that the file is simply not present at the URL you are trying to load it from. Check your developer tools and you will most likely see a 404 - Not Found response for the request.

    Comment


      #3
      Hi Isomorphic,

      I have checked in the inspect Network, FileLoader.js' is loaded. only the definition is wrong - cacheISC(),
      Code:
       <script> isc.FileLoader.cacheISC();</script>
      Click image for larger version  Name:	fileloader1PNG.PNG Views:	0 Size:	1.5 KB ID:	262784
      - does this because its not compatibility in jsp , or no need to added in jsp or it doesnt have in FileLoader.js ( I can't see any definition with cachISC() only with paremeters) ,
      https://www.smartclient.com/smartcli...ct..FileLoader

      If you're not working in a JSP environment, you can use the FileLoader.cacheISC()/FileLoader.loadISC() APIs to accomplish the same effect as the loadISC JSP tag.

      - only isc.FileLoader.cacheISC(); is undefined.


      - load jsp tag is part of this : <%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isc" %>


      Warm Regards,
      Frank

      Comment


        #4
        So again, you are not successfully loading the FileLoader module at all. It's not just cacheISC, from your first post, isc is not defined at all, which also means isc.FileLoader cannot be defined - this has nothing to do with the cacheISC function specifically.

        Nothing is special about ISC_FileLoader.js - it's just a JavaScript file. If you can load a JavaScript file at all, you can succeed in loading this file. Look over your HTML very carefully; you're going to find something very simple wrong, like a misspelled <script> tag (eg it actually says "scipt" for example), or, the logic where you are trying to call isc.FileLoader APIs is placed before ISC_FileLoader.js in the page. Something like that.

        Comment


          #5
          on Html (main page after login), its been declared with FileLoader.js and successfully loaded all the ISC_* Files from 'modulsDir' ,

          a. aut_login.jsp

          Code:
          <SCRIPT SRC="ISC_FileLoader.js" defer="defer"></SCRIPT>
           <script>isc.FileLoader.cacheISC();</script>
          b. index.html (main landing page)

          Code:
           <SCRIPT>window.isomorphicDir='fndong/'</SCRIPT>
              <SCRIPT SRC="fndong/modules/ISC_FileLoader.js"></SCRIPT>
              <SCRIPT>
                  isc.FileLoader.modulesDir = "fndong/modules/";
              </SCRIPT>

          Question : Do I need just remove '<script>isc.FileLoader.cacheISC();</script>' in aut_login.jsp , seems its work loaded in 'index.html' ,

          it seems its not work in *.jsp file, to set FileLoader in jsp , I read in forum, the FileLoader are declared by using iscTaglib.xml


          Really hope,
          Franko

          Comment


            #6
            I think I began to understand ,

            does the declaration I made in aut_login.jsp (landing page) , it just for performance purpose , does it effect the load in index.html loading or just in aut_login.jsp :

            to reduce application load time for first-time users who have not yet cached these files.
            Code:
             <SCRIPT>window.isomorphicDir='fndong/'</SCRIPT>    
            <SCRIPT SRC="fndong/modules/ISC_FileLoader.js"></SCRIPT>    
            <SCRIPT>         isc.FileLoader.modulesDir = "fndong/modules/";    
            </SCRIPT>

            Comment


              #7
              Your problem is defer="true" on the script tag. This means the file the doesn't need to be immediately loaded, so subsequent JavaScript cannot assume it's there. Remove this.

              Comment

              Working...
              X