Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Object Required

Reply
Thread Tools

Object Required

 
 
Mark Constant
Guest
Posts: n/a
 
      01-28-2004
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='CallXML(this.form.select1, "PS2");'>
<option selected>Please Select a Genre</option>
<option value="All">All</option>
<option value="Fighting">Fighting</option>
<option value="FPS">First Person Shooter</option>
<option value="Platformer">Platformer</option>
<option value="Sports">Sports</option>
<option value="TPA">Third Person Action</option>
</select>
</div>

Here is the Javascript file
function CallXML(dropdown, Hardware)
{
var myIndex = dropdown.selectedIndex;
var SelValue = dropdown.options[myIndex].value;
var xsltTree = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0" );
xsltTree.async = false;
xsltTree.load("Entertainment.xslt");

var srcTree = new ActiveXObject("Msxml2.DOMDocument.4.0");
srcTree.async = false;
srcTree.load("Entertainment.xml");


var xsltThread = new ActiveXObject("Msxml2.XSLTemplate.4.0");
xsltThread.stylesheet = xsltTree;
var xsltProc = xsltThread.createProcessor();
xsltProc.input = srcTree;
xsltProc.addParameter("Genre", SelValue);
xsltProc.addParameter("Hardware", Hardware);

xsltProc.transform();
document.all.layer1.innerHTML = xsltProc.output;
}
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-28-2004


Mark Constant wrote:

> 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.


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


> <select name="select1"
> onchange='CallXML(this.form.select1, "PS2");'>


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


> function CallXML(dropdown, Hardware)
> {
> var myIndex = dropdown.selectedIndex;
> var SelValue = dropdown.options[myIndex].value;
> var xsltTree = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0" );


This can only work with IE on Windows if MSXML 4 is installed. No IE
version installs that, IE6 only installs MSXML 3.

> xsltTree.async = false;
> xsltTree.load("Entertainment.xslt");
>
> var srcTree = new ActiveXObject("Msxml2.DOMDocument.4.0");
> srcTree.async = false;
> srcTree.load("Entertainment.xml");
>
>
> var xsltThread = new ActiveXObject("Msxml2.XSLTemplate.4.0");
> xsltThread.stylesheet = xsltTree;
> var xsltProc = xsltThread.createProcessor();
> xsltProc.input = srcTree;
> xsltProc.addParameter("Genre", SelValue);
> xsltProc.addParameter("Hardware", Hardware);
>
> xsltProc.transform();
> document.all.layer1.innerHTML = xsltProc.output;
> }


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
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
Mark Constant
Guest
Posts: n/a
 
      01-28-2004
Martin Honnen <(E-Mail Removed)> wrote in message news:<4017a1c0$(E-Mail Removed)>...
> Mark Constant wrote:
>
> > 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.

>
> Which browser gives that error message? Which line is given as causing
> the error?
>
>
> > <select name="select1"
> > onchange='CallXML(this.form.select1, "PS2");'>

>
> CallXML(this, "PS2");
> should suffice.
> <option value="Fighting">Fighting</option>
>
>
> > function CallXML(dropdown, Hardware)
> > {
> > var myIndex = dropdown.selectedIndex;
> > var SelValue = dropdown.options[myIndex].value;
> > var xsltTree = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0" );

>
> This can only work with IE on Windows if MSXML 4 is installed. No IE
> version installs that, IE6 only installs MSXML 3.
>
> > xsltTree.async = false;
> > xsltTree.load("Entertainment.xslt");
> >
> > var srcTree = new ActiveXObject("Msxml2.DOMDocument.4.0");
> > srcTree.async = false;
> > srcTree.load("Entertainment.xml");
> >
> >
> > var xsltThread = new ActiveXObject("Msxml2.XSLTemplate.4.0");
> > xsltThread.stylesheet = xsltTree;
> > var xsltProc = xsltThread.createProcessor();
> > xsltProc.input = srcTree;
> > xsltProc.addParameter("Genre", SelValue);
> > xsltProc.addParameter("Hardware", Hardware);
> >
> > xsltProc.transform();
> > document.all.layer1.innerHTML = xsltProc.output;
> > }

>
> 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?


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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a VD with required properties on a required Web Server (Windows Advanced Server 2000 has 3 Web Servers) Just D. ASP .Net 0 03-10-2006 06:02 AM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
Error: VBScript runtime (0x800A01A8) Object required: '[object]' Carolyn Speakman XML 1 07-30-2004 07:40 AM
Recordset - Object Required rob ASP .Net 6 06-15-2004 01:36 PM
Object reference required (question) Bucko ASP .Net 1 10-24-2003 11:37 PM



Advertisments