Object Required

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Constant

    Object Required

    I have a select box in HTML that calls upon a Javascript file.
    Whenever I call the Javascript file it says "Object Required" for an
    error message. I got it working before but don't remember how.

    Here is the drop-down menu that calls the Javascript file
    <div id="layer1" name="layer1">
    <div align="center"> <select name="select1"
    onchange='CallX ML(this.form.se lect1, "PS2");'>
    <option selected>Please Select a Genre</option>
    <option value="All">All </option>
    <option value="Fighting ">Fighting</option>
    <option value="FPS">Fir st Person Shooter</option>
    <option value="Platform er">Platforme r</option>
    <option value="Sports"> Sports</option>
    <option value="TPA">Thi rd Person Action</option>
    </select>
    </div>

    Here is the Javascript file
    function CallXML(dropdow n, Hardware)
    {
    var myIndex = dropdown.select edIndex;
    var SelValue = dropdown.option s[myIndex].value;
    var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
    xsltTree.async = false;
    xsltTree.load(" Entertainment.x slt");

    var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
    srcTree.async = false;
    srcTree.load("E ntertainment.xm l");


    var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
    xsltThread.styl esheet = xsltTree;
    var xsltProc = xsltThread.crea teProcessor();
    xsltProc.input = srcTree;
    xsltProc.addPar ameter("Genre", SelValue);
    xsltProc.addPar ameter("Hardwar e", Hardware);

    xsltProc.transf orm();
    document.all.la yer1.innerHTML = xsltProc.output ;
    }
  • Martin Honnen

    #2
    Re: Object Required



    Mark Constant wrote:
    [color=blue]
    > I have a select box in HTML that calls upon a Javascript file.
    > Whenever I call the Javascript file it says "Object Required" for an
    > error message.[/color]

    Which browser gives that error message? Which line is given as causing
    the error?

    [color=blue]
    > <select name="select1"
    > onchange='CallX ML(this.form.se lect1, "PS2");'>[/color]

    CallXML(this, "PS2");
    should suffice.
    <option value="Fighting ">Fighting</option>

    [color=blue]
    > function CallXML(dropdow n, Hardware)
    > {
    > var myIndex = dropdown.select edIndex;
    > var SelValue = dropdown.option s[myIndex].value;
    > var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");[/color]

    This can only work with IE on Windows if MSXML 4 is installed. No IE
    version installs that, IE6 only installs MSXML 3.
    [color=blue]
    > xsltTree.async = false;
    > xsltTree.load(" Entertainment.x slt");
    >
    > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
    > srcTree.async = false;
    > srcTree.load("E ntertainment.xm l");
    >
    >
    > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
    > xsltThread.styl esheet = xsltTree;
    > var xsltProc = xsltThread.crea teProcessor();
    > xsltProc.input = srcTree;
    > xsltProc.addPar ameter("Genre", SelValue);
    > xsltProc.addPar ameter("Hardwar e", Hardware);
    >
    > xsltProc.transf orm();
    > document.all.la yer1.innerHTML = xsltProc.output ;
    > }[/color]

    Let us know the details, which browser you have tried with, which line
    is causing the errror, whether MSXML 4 is installed.
    Are the XML and the XSLT file well-formed?
    --

    Martin Honnen


    Comment

    • Mark Constant

      #3
      Re: Object Required

      Martin Honnen <mahotrash@yaho o.de> wrote in message news:<4017a1c0$ 1@olaf.komtel.n et>...[color=blue]
      > Mark Constant wrote:
      >[color=green]
      > > I have a select box in HTML that calls upon a Javascript file.
      > > Whenever I call the Javascript file it says "Object Required" for an
      > > error message.[/color]
      >
      > Which browser gives that error message? Which line is given as causing
      > the error?
      >
      >[color=green]
      > > <select name="select1"
      > > onchange='CallX ML(this.form.se lect1, "PS2");'>[/color]
      >
      > CallXML(this, "PS2");
      > should suffice.
      > <option value="Fighting ">Fighting</option>
      >
      >[color=green]
      > > function CallXML(dropdow n, Hardware)
      > > {
      > > var myIndex = dropdown.select edIndex;
      > > var SelValue = dropdown.option s[myIndex].value;
      > > var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");[/color]
      >
      > This can only work with IE on Windows if MSXML 4 is installed. No IE
      > version installs that, IE6 only installs MSXML 3.
      >[color=green]
      > > xsltTree.async = false;
      > > xsltTree.load(" Entertainment.x slt");
      > >
      > > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
      > > srcTree.async = false;
      > > srcTree.load("E ntertainment.xm l");
      > >
      > >
      > > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
      > > xsltThread.styl esheet = xsltTree;
      > > var xsltProc = xsltThread.crea teProcessor();
      > > xsltProc.input = srcTree;
      > > xsltProc.addPar ameter("Genre", SelValue);
      > > xsltProc.addPar ameter("Hardwar e", Hardware);
      > >
      > > xsltProc.transf orm();
      > > document.all.la yer1.innerHTML = xsltProc.output ;
      > > }[/color]
      >
      > Let us know the details, which browser you have tried with, which line
      > is causing the errror, whether MSXML 4 is installed.
      > Are the XML and the XSLT file well-formed?[/color]

      The error is in IE6 with MSXML installed and the error is
      Line: 79 (Which is the beginning of the select statement)
      Char: 1
      Error: Object required
      Code:0

      I know the XML and XSLT are well-formed because I can use an only page
      I had made and it works fine. For some reason I can't find any
      differences in syntax between my old page and my new one.

      Comment

      Working...