DHTML for FireFox and other browsers
7 posts • Page 1 of 1
April 14th, 2006, 6:00 pm
Is there documentation somewhere that describes how to write cross browser DHTML?
I've written a small DHTML that works perfectly in MS IE, but I get nothing in Firefox. I need to build a table dynamically and be able to click the cells to raise an event. So any information on the Firefox implementation of DHTML will be appreciated. Thanks, King Wilder
April 14th, 2006, 6:27 pm
If you post your code in this thread we may be able to help. To make it stand out better insert it between <b>[code]</b> and <b> [/code]</b> tags to make it stand out.
April 14th, 2006, 7:01 pm
There's actually too much to post in this message, so I just posted it to my site.
http://www.kingwilder.com/wizard/index.html View the source to get all the Javascript. I got the table working in IE and Firefox, now I'm working on getting cell clicks to work in both. I want to be able to toggle the color of a cell between grey and black when the cell is clicked. I really didn't get that far yet. I tried testing it in Firefox and I couldn't get the table to display at all, but I figured that part out. Any ideas would be appreciated. Thanks, King
April 14th, 2006, 7:22 pm
I see what you mean. Plenty of it. I'll have a look to see if I can offer some suggestions.
April 14th, 2006, 7:31 pm
for specific questions, feel free to post in the web development forum here.
Firefox has good support for DOM standards. ("DHTML" is a term that usually refers to Microsoft's specific implementation of DOM. DOM is the term you're looking for.) Firefox's DOM support is pretty well documented here: http://developer.mozilla.org/en/docs/Ge ... _Reference As you look, you'll notice that when standards apply, Firefox closely follows DOM standards. Some of those standards that Firefox has mostly covered are: http://www.w3.org/TR/DOM-Level-2-Core/core.html http://www.w3.org/TR/DOM-Level-2-HTML/html.html http://www.w3.org/TR/DOM-Level-2-Style/css.html http://www.w3.org/TR/DOM-Level-2-Events/ For example, Firefox handles events according to the DOM Event standards. You can read more about Firefox's implementation of events here, which will probably solve your problem.
April 14th, 2006, 8:45 pm
I've just had a quick tinker and come up with a slightly more compact version that achieves your first step. (ie creates the table and makes the cells selectable).
BTW. I find that it's not a good idea to insert a bare TABLE into the HTML as different browsers do different things concerning the TBODY. Some automatically introduce it, some don't. This then gives your javascript a problem of sorting out wether the TBODY already exists or not. Another tip. If you add the onclick attribute to your tag as you create it. The function that gets called has a reference to the element using the keyword this (note my use of it in the onclickCell function below. For future posts, you would be well advised to just post the snippets you're trying to debug. In the development forum. Anyhow. Here's my quick and dirty rendition.
April 15th, 2006, 10:09 am
texmex,
Thanks for the info. I like the way you streamlined the click event procedure. I can work with this. And in the future I will submit only appropriate code. jqp, Thanks for the links on the Gecko DOM. I guess my terminology was off. I usually build DHTML clients for business customers that only use IE in offices. I haven't had to build cross-browser applications that need to simulate DHTML up to now. This information will help a lot. King
7 posts • Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 7 guests |
|