From: Tony on
I have a select with an onchange - it works find in Firefox, but in IE
6 I get an error: Object Expected.

I have simplified things drastically, and still get the error.

The HTML:

<select name="viewtrain" id="viewtrain" onchange="viewDetails(this);">
<option value="1">Train 1</option>
<option value="2">Train 2</option>
<option value="3">Train 3</option>
</select>

and the javascript:

function viewDetails(sel)
{
alert('hi');
}

For some reason, this fails. But if I replace viewDetails with an
alert:
<select name="viewtrain" id="viewtrain" onchange="alert(this);">
everything works correctly.

For some reason, it seems that IE isn't 'seeing' viewDetails.

-
OK I did a bit more checking before posting, and it seems that the js
file isn't loading at all - but only in IE. I can't imagine why.
here's the source:

<script type="text/javascript" src="js/CalendarPopup.js"></script>
<script type="text/javascript" src="js/details.js"></script>
<script type="text/javascript">
ACTIVE_SECTION = 'Late Trains Details';
</script>

The stuff before and after works fine. Only details.js is not loading
- and only in IE.

I'm stumped on this one...
From: ellaiah.pusa on
stumps me too.


On Apr 23, 4:33 pm, Tony <23.t...(a)gmail.com> wrote:
> I have a select with an onchange - it works find in Firefox, but in IE
> 6 I get an error: Object Expected.
>
> I have simplified things drastically, and still get the error.
>
> The HTML:
>
> <select name="viewtrain" id="viewtrain" onchange="viewDetails(this);">
>   <option value="1">Train 1</option>
>   <option value="2">Train 2</option>
>   <option value="3">Train 3</option>
> </select>
>
> and the javascript:
>
> function viewDetails(sel)
> {
>   alert('hi');
>
> }
>
> For some reason, this fails. But if I replace viewDetails with an
> alert:
> <select name="viewtrain" id="viewtrain" onchange="alert(this);">
> everything works correctly.
>
> For some reason, it seems that IE isn't 'seeing' viewDetails.
>
> -
> OK I did a bit more checking before posting, and it seems that the js
> file isn't loading at all - but only in IE. I can't imagine why.
> here's the source:
>
> <script type="text/javascript" src="js/CalendarPopup.js"></script>
> <script type="text/javascript" src="js/details.js"></script>
> <script type="text/javascript">
> ACTIVE_SECTION = 'Late Trains Details';
> </script>
>
> The stuff before and after works fine. Only details.js is not loading
> - and only in IE.
>
> I'm stumped on this one...

From: Andrew Bailey on

<ellaiah.pusa(a)gmail.com> wrote in message
news:4bfddd0c-f8d8-4080-b6fd-12ce80db52ad(a)59g2000hsb.googlegroups.com...
stumps me too.


On Apr 23, 4:33 pm, Tony <23.t...(a)gmail.com> wrote:
> I have a select with an onchange - it works find in Firefox, but in IE
> 6 I get an error: Object Expected.
>
> I have simplified things drastically, and still get the error.
>
> The HTML:
>
> <select name="viewtrain" id="viewtrain" onchange="viewDetails(this);">
> <option value="1">Train 1</option>
> <option value="2">Train 2</option>
> <option value="3">Train 3</option>
> </select>
>
> and the javascript:
>
> function viewDetails(sel)
> {
> alert('hi');
>
> }
>
> For some reason, this fails. But if I replace viewDetails with an
> alert:
> <select name="viewtrain" id="viewtrain" onchange="alert(this);">
> everything works correctly.
>
> For some reason, it seems that IE isn't 'seeing' viewDetails.
>
> -
> OK I did a bit more checking before posting, and it seems that the js
> file isn't loading at all - but only in IE. I can't imagine why.
> here's the source:
>
> <script type="text/javascript" src="js/CalendarPopup.js"></script>
> <script type="text/javascript" src="js/details.js"></script>
> <script type="text/javascript">
> ACTIVE_SECTION = 'Late Trains Details';
> </script>
>
> The stuff before and after works fine. Only details.js is not loading
> - and only in IE.
>
> I'm stumped on this one...

Is it because you're calling details.js but the actual file is called
Details.js with a capital?

Andy

From: Tony on
On Apr 23, 1:59 am, "Andrew Bailey" <a...(a)REMOVETOEMAILMEmanyplay.com>
wrote:
> <ellaiah.p...(a)gmail.com> wrote in message
>
> news:4bfddd0c-f8d8-4080-b6fd-12ce80db52ad(a)59g2000hsb.googlegroups.com...
> stumps me too.
>
> On Apr 23, 4:33 pm, Tony <23.t...(a)gmail.com> wrote:
>
>
>
> > I have a select with an onchange - it works find in Firefox, but in IE
> > 6 I get an error: Object Expected.
>
> > I have simplified things drastically, and still get the error.
>
> > The HTML:
>
> > <select name="viewtrain" id="viewtrain" onchange="viewDetails(this);">
> > <option value="1">Train 1</option>
> > <option value="2">Train 2</option>
> > <option value="3">Train 3</option>
> > </select>
>
> > and the javascript:
>
> > function viewDetails(sel)
> > {
> > alert('hi');
>
> > }
>
> > For some reason, this fails. But if I replace viewDetails with an
> > alert:
> > <select name="viewtrain" id="viewtrain" onchange="alert(this);">
> > everything works correctly.
>
> > For some reason, it seems that IE isn't 'seeing' viewDetails.
>
> > -
> > OK I did a bit more checking before posting, and it seems that the js
> > file isn't loading at all - but only in IE. I can't imagine why.
> > here's the source:
>
> > <script type="text/javascript" src="js/CalendarPopup.js"></script>
> > <script type="text/javascript" src="js/details.js"></script>
> > <script type="text/javascript">
> > ACTIVE_SECTION = 'Late Trains Details';
> > </script>
>
> > The stuff before and after works fine. Only details.js is not loading
> > - and only in IE.
>
> > I'm stumped on this one...
>
> Is it because you're calling details.js but the actual file is called
> Details.js with a capital?
>
> Andy

That wasn't the problem - I had rechecked the path & capitalization.

Finally figured it out. There was a variable named 'class' in the
file. Apparently, IE doesn't like that. Changing it to 'classname'
fixed the problem.
From: Thomas 'PointedEars' Lahn on
Tony wrote:
> [...] "Andrew Bailey" [...] wrote:
>> <ellaiah.p...(a)gmail.com> wrote [...]:
>> On Apr 23, 4:33 pm, Tony <23.t...(a)gmail.com> wrote:
>>> [...]
>>> <script type="text/javascript" src="js/CalendarPopup.js"></script>
>>> <script type="text/javascript" src="js/details.js"></script>
>>> <script type="text/javascript">
>>> ACTIVE_SECTION = 'Late Trains Details';
>>> </script>
>>> The stuff before and after works fine. Only details.js is not loading
>>> - and only in IE.
>>> I'm stumped on this one...
>> Is it because you're calling details.js but the actual file is called
>> Details.js with a capital?
>> [...]
>
> That wasn't the problem - I had rechecked the path & capitalization.
>
> Finally figured it out. There was a variable named 'class' in the
> file. Apparently, IE doesn't like that. Changing it to 'classname'
> fixed the problem.

No ECMAScript-compliant engine likes it if you use reserved words for
identifiers.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7(a)news.demon.co.uk>