> Programming Languages > Javascript
Various Topics Home | Disclaimer | Report Adult Posts

Various Topics on Javascript



Javascript - "Mac OS X IE 5.2 vs javascript" in Programming Languages


Old 04-07-2004   #1
..b.. ..ck..
 
Default Mac OS X IE 5.2 vs javascript

I'm trying to fix a problem in IE 5.2 javascript on mac OS 10.2.

Basically the problem is that we're writing dynamic form elements and these
don't seem to be recognized by the form.

The code that does the writing looks like
///////////////////////////////////////
var IE4 = do***ent.all ? 1 : 0;
var NS4 = do***ent.layers ? 1 : 0;
var DOM = (!IE4 && do***ent.getElementById) ? 1 : 0;

function wlayer(name,html){
var out;
if(NS4){
out = do***ent.layers[name];
out.do***ent.open();
out.do***ent.write(html);
out.do***ent.close();
}
else if(IE4){
out = do***ent.frames ? do***ent.frames[name] : do***ent.all[name];
out.innerHTML=html;
}
else if(DOM){
out = do***ent.getElementById(name);
out.innerHTML=html;
}
}
///////////////////////////////////////

This code seems well able to write lumps of HTML into the do***ent
at specified div's etc etc and the appearance of the page changes.
Any <a tags> in the dynamically changed section seem to work.

However, if the written html contains for variables eg
<input type="checkbox" name="cb0"> then the form into which the
html is written doesn't seem to see the new inputs.

This code works well in IE5,6 Mozilla etc so what does Mac IE 5 need me
to do?

Robin Becker

--
Robin Becker
 
Old 04-08-2004   #2
..be..
 
Default Re: Mac OS X IE 5.2 vs javascript


> The code that does the writing looks like
> ///////////////////////////////////////
> var IE4 = do***ent.all ? 1 : 0;
> var NS4 = do***ent.layers ? 1 : 0;
> var DOM = (!IE4 && do***ent.getElementById) ? 1 : 0;
>
> function wlayer(name,html){
> var out;
> if(NS4){
> out = do***ent.layers[name];
> out.do***ent.open();
> out.do***ent.write(html);
> out.do***ent.close();
> }
> else if(IE4){
> out = do***ent.frames ? do***ent.frames[name] : do***ent.all[name];
> out.innerHTML=html;
> }
> else if(DOM){
> out = do***ent.getElementById(name);
> out.innerHTML=html;
> }
> }

Why don't you try the DOM path by putting the DOM test before the IE4
test? Doesn't your code in IE5 and IE6 take the IE4 path because
do***ent.all still exists?

Robert
 
Old 04-08-2004   #3
..cha.. ..nt..
 
Default Re: Mac OS X IE 5.2 vs javascript

On Wed, 07 Apr 2004 14:39:50 +0100, Robin Becker <robin@reportlab.com>
wrote:

> I'm trying to fix a problem in IE 5.2 javascript on mac OS 10.2.
>
> Basically the problem is that we're writing dynamic form elements and
> these don't seem to be recognized by the form.


[snipped nasty script]

I suggest you read:

<URL:http://jibbering.com/faq/#FAQ4_26>

and its links.

> This code seems well able to write lumps of HTML into the do***ent
> at specified div's etc etc and the appearance of the page changes.
> Any <a tags> in the dynamically changed section seem to work.
>
> However, if the written html contains for variables eg
> <input type="checkbox" name="cb0"> then the form into which the
> html is written doesn't seem to see the new inputs.


Also read:

<URL:http://jibbering.com/faq/#FAQ4_15>

and its links.

Mike

--
Michael Winter
M.Winter@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
 

Thread Tools
Display Modes





Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0