SketchUcation Premium Membership

 

 

Js / DOM / HTML questions

Js / DOM / HTML questions

Postby Dan Rathbun » Mon Jul 09, 2012 12:54 am

This is probably aimed at ThomThom:

Does MSIE 8, support DOM Level 3 ?

What I'm I'm wondering is if I can do this, for cross-platform:

document.head

EDIT: "document.head is null or not an object"

instead of:

document.getElementsByTagName('head')[0]

.. and the other question is:

Do both Safari (latest ver,) and MSIE 8 support the insertBefore method (which I'd like to use, instead of the appendChild method.)
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4069
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Js / DOM / HTML questions

Postby thomthom » Mon Jul 09, 2012 11:17 am

hm... I do not remember. I've been using jQuery for the last few years now. It's taken care of most my DOM cross platform worries. I now deal pretty much exclusively with the jQuery API and I just get things done instead of messing about with the awkward DOM API.

Probably not quite the answer you where looking for, but really, using a framework for dealing with the DOM is a completely different world and it'll save your hairs from going grey.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17544
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Js / DOM / HTML questions

Postby Dan Rathbun » Mon Jul 09, 2012 2:53 pm

I know this.. you've said it before.
This is different... I'm injecting a line (A SINGLE LINE,) of html from the Ruby side
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4069
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Js / DOM / HTML questions

Postby thomthom » Mon Jul 09, 2012 3:33 pm

I see.

Quirks mode is really nice for looking up compatibility:
http://www.quirksmode.org/dom/w3c_core.html#t92

I often just google the keyword followed by "quirksmode" and the top result is usually from quirksmode.org.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17544
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Js / DOM / HTML questions

Postby Dan Rathbun » Mon Jul 09, 2012 4:21 pm

Holy WoW! That's a great site !

I've been hoping for something like that for Ruby, so we can see when methods are valid.
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4069
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Js / DOM / HTML questions

Postby Dan Rathbun » Mon Jul 09, 2012 4:40 pm

Dan Rathbun wrote:What I'm I'm wondering is if I can do this, for cross-platform:

document.head


OK I understand now (those new MSDN pages are so confusing!)

document.head is part of HTML 5.

http://stackoverflow.com/questions/7557 ... ch-scripts
and
http://www.whatwg.org/specs/web-apps/cu ... ument-head
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4069
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Artisan Organic Toolset - a set of powerful organic modeling tools.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012



 

Return to Developers' Forum

Who is online

Users browsing this forum: Bing [Bot], Dik Harrison, francescole, Polygony and 2 guests