Object expected error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chakotay2
    New Member
    • Jun 2008
    • 3

    Object expected error

    Getting an object expected error...
    Line 6, character 1....
    site is: wfpk9.org

    Please help! I am SUPER new to java/dhtml... and really don't know what I am doing...
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    just include the js-library before calling a function of it:

    put this line:

    Code:
    <script type="text/javascript" language="JavaScript1.2" src="stm31.js"></script>
    before your current line 4. that should fix it ...

    kind regards

    Comment

    • chakotay2
      New Member
      • Jun 2008
      • 3

      #3
      Hi, the menu is being inserted as a library file... (that way I can use it on many pages and easily change it on just the library file...) So, based on that I am not sure where to insert that line... It looks like its in there but further at the bottom of the index.html (and other pages)...

      Here is the original contents of the lbi file:
      Code:
      <script type="text/javascript" id="sothink_dhtmlmenu"> <!--
       st_siteroot="file:///C|/Documents%20and%20Settings/Crist/My%20Documents/Allen/South%20Jordan%20Files/Multi-Agency%20K9";
       st_jspath="/stmenu.js";
       if(!window.location.href.indexOf("file:") && st_jspath.charAt(0)=="/")
        document.write('<script type="text/javascript" src="'+st_siteroot+st_jspath+'"><\/script>');
       else 
        document.write('<script type="text/javascript" src="'+st_jspath+'"><\/script>');
      //--> </script>
      <link href="../stylesheet.css" rel="stylesheet" type="text/css">
      <script type="text/javascript" id="sothink_dhtmlmenu"> <!--
       st_siteroot="file:///C|/Documents%20and%20Settings/Crist/My%20Documents/Allen/South%20Jordan%20Files/Multi-Agency%20K9";
       st_jspath="/stmenu.js";
       if(!window.location.href.indexOf("file:") && st_jspath.charAt(0)=="/")
        document.write('<script type="text/javascript" src="'+st_siteroot+st_jspath+'"><\/script>');
       else 
        document.write('<script type="text/javascript" src="'+st_jspath+'"><\/script>');
      //--> </script>
      <span>
      <script id="sothink_widgets:dwwidget_dhtmlmenu5_5_2008.pgt" type="text/javascript">
      <!--
      stm_bm(["menu547a",850,"/","blank.gif",0,"","",1,0,250,0,1000,1,0,0,"","100%",0,0,1,2,"default","hand","file:///C|/Documents%20and%20Settings/Crist/My%20Documents/Allen/South%20Jordan%20Files/Multi-Agency%20K9"],this);
      stm_bp("p0",[0,4,0,0,2,3,0,7,100,"",-2,"",-2,50,0,0,"#009933","transparent","",3,1,3,"#009933"]);
      stm_ai("p0i0",[0,"Home","","",-1,-1,0,"http://www.wfpk9.org/index.html","_self","","","","",0,0,0,"","",0,0,0,1,1,"#000000",0,"#000000",0,"","",3,3,1,3,"#009933","#000000","#009933","#33ff00","8pt Verdana","8pt Verdana",0,0]);
      stm_aix("p0i1","p0i0",[0,"Member Agencies","","",-1,-1,0,"http://www.wfpk9.org/member.html"]);
      stm_aix("p0i2","p0i0",[0,"Services Provided","","",-1,-1,0,"http://www.wfpk9.org/services.html"]);
      stm_aix("p0i3","p0i0",[0,"K9 Photos","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow_r.gif","arrow_r.gif",7,7]);
      stm_bp("p1",[1,4,0,0,2,3,0,0,100,"",-2,"",-2,50,0,0,"#999999","#E6EFF9","",3,1,1,"#000000"]);
      stm_aix("p1i0","p0i0",[0,"Sandy Police Department","","",-1,-1,0,"http://www.wfpk9.org/spdp.html","_self","","","","",0,0,0,"","",0,0,0,0]);
      stm_aix("p1i1","p1i0",[0,"South Salt Lake Police Department","","",-1,-1,0,"http://www.wfpk9.org/sslpdp.html"]);
      stm_aix("p1i2","p1i1",[0,"West Jordan Police Department","","",-1,-1,0,"http://www.wfpk9.org/wjpdp.html"]);
      stm_aix("p1i3","p1i1",[0,"Utah Highway Patrol","","",-1,-1,0,"http://www.wfpk9.org/uhpp.html"]);
      stm_ep();
      stm_aix("p0i4","p0i0",[0,"Support Us","","",-1,-1,0,"http://www.wfpk9.org/support.html"]);
      stm_aix("p0i5","p0i4",[0,"Contact Us","","",-1,-1,0,"http://www.wfpk9.org/contact.html"]);
      stm_aix("p0i6","p0i4",[0,"FAQ\'S","","",-1,-1,0,"http://www.wfpk9.org/faqs.html"]);
      stm_aix("p0i7","p0i0",[0,"Forums (members only)","","",-1,-1,0,"http://www.wfpk9.org/forums"]);
      stm_ep();
      stm_em();
      //-->
      </script>
      </span>

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5388

        #4
        it seems to be something that should write the script-include dynamically to a page? i hate that usage ... ;) in case you want to do such things then try to ensure that the correct source is written to the page before you call any function of the lib ... as i told you already. the current problem is exactly this: you try to call such a sothink-function when there is no script-include before ... so that function is undefined ... and you get the error.

        you could include all scripts in your index-page (a frameset?) and refer from the child-pages to that window with parent, top or whatever is appropriate in any case ... and so you have just one script-include and avoid that 'ugly' clientside document.write-like include ...

        kind regards

        Comment

        • chakotay2
          New Member
          • Jun 2008
          • 3

          #5
          hmmm, I don't know how to do that (the frameset) I guess... any hints?
          Last edited by chakotay2; Jun 10 '08, 01:15 PM. Reason: correction

          Comment

          Working...