[thelist] xml in javascript ie does show it

gruppenfreizeit postmeister at gruppenfreizeit.com
Sat Oct 22 22:07:38 CDT 2005


Hi,


><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Like IE needs the TR element to display the tablerows.
> Mozilla not. [...]
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

----------------------------------------------------------------------------
-
---Then Mozilla is ignoring the spec because a TR element is a required
table
---element.
----------------------------------------------------------------------------
-

It's the same if you're using Mozilla and enter the TR or not,
like the tbody Element, like the setAttribute for css style or
element.style.anotherstyle,...

----------------------------------------------------------------------------
------
---Actually, I think the opposite is true.  Mozilla is very intolerant of
---certain invalid markup while IE is very forgiving, often "fixing" the
markup
---prior to rendering it so that it can at least be rendered.
-------------------------------------------------------------------------
Think twice, you're surely right with javascripts except the dom.
It's one thing to forgive a forgotten ";" and run the code further on like a
vb onerror.resume.next command
or to support many different styles of input.



><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> [...] el.onclick=function(){do something};
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
----------------------------------------------------------------------
---I've never experienced any difficult using this approach provided I'm
---referring to an event handler IE supports for the element I'm working
with.
---------------------------------------------------------------------

This is good as long as you change the same side.
In my opinion it seems to be like the whole function informations are gone
after a
reload of the control frame.

-----------------------------------------------------------------
---el.onclick = function()
---{
---  myfunction(somevar, somevar2);
---}
---------------------------------------------------------------------------

That's not working for me in cross side scripting nor in Mozilla neither in
IE.

----------------------------------------------------------------------------
---
---If you're still struggling with this, put something online and shoot
thelist
---a message with a link to it
----------------------------------------------------------------------------
---------
The prob is solved now by an A Element which calls the function in another
frame.

Now the code is rewritten
I appreciate your help and will come back to your offer, when I optimize it.

============================================================================
===========




Hi,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: gruppenfreizeit
>
> My page2 is reloading each second.
> The prob is to recall a function after page2 is reloaded.
>
> page2 sets some elements into page1
>
> while($o<$cnt){
> if(somethingHappens){
> 		print 'var y = x.createElement("TR");';
> 		print 'var el = x.createElement("TD");';
>
> 		print 'el.onclick=function(){do something;};';
>
> 		print 'y.appendChild(el);';
> 		print 'tbl.appendChild(y);';
> }}
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

First, build the page out *without* using whatever server-side language
you're using.  Then, you can see if the culprit is something being added or
altered by your server-side code or not.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> This runs well in Mozilla, IE stopped doing the function
> after one click.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

What steps have you taken to confirm that IE is no longer executing the
function after the even fires the first time?

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Further on mouseover and mouseout events have been very
> instabil in IE 6.x
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

This is something else I've never personally had any issues with.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Next fact is Mozilla is much more tolerant in different
> codes.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

Actually, I think the opposite is true.  Mozilla is very intolerant of
certain invalid markup while IE is very forgiving, often "fixing" the markup
prior to rendering it so that it can at least be rendered.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Like IE needs the TR element to display the tablerows.
> Mozilla not. [...]
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

Then Mozilla is ignoring the spec because a TR element is a required table
element.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> [...] Then Mozilla always works if I use
> setAttribute("onlick",
> "function myfunction(do something)") [...]
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

That's not valid code, no matter which browser.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> [...] el.onclick=function(){do somthing};
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

I've never experienced any difficult using this approach provided I'm
referring to an event handler IE supports for the element I'm working with.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> or want to set style elements as attributes.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

Yes, there are issues with that in IE, granted.  However, there is a valid
alternative to using the setAttribute() method.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> How can I call a function, which is coded in page1 ?
> print 'el.onclick=function myfunction();'; is not
> working.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

If the function is already defined, then you can call it like this:

el.onclick = myfunction;

Notice the lack of parenthesis.  If you *have* to pass arguments to your
function, then you'll need to do it like this:

el.onclick = function()
{
  myfunction(somevar, somevar2);
}

If you're still struggling with this, put something online and shoot thelist
a message with a link to it.

 [>] Jeff Howden
     jeff at jeffhowden.com
     http://jeffhowden.com/

--

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !




More information about the thelist mailing list