Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
hijacking document.createElement makes life easier
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Deal  
View profile  
 More options Aug 19 2011, 2:45 pm
From: Michael Deal <mudc...@gmail.com>
Date: Fri, 19 Aug 2011 11:45:54 -0700 (PDT)
Local: Fri, Aug 19 2011 2:45 pm
Subject: hijacking document.createElement makes life easier
Hi, I thought this might be useful to some people-- you can hijack
document.createElement to use FlashCanvas.  This makes it so you don't
have to spend a bunch of time adding if (typeof's) to larger pre-
existing canvas projects.

document.createElementOverride = document.createElement;
document.createElement = function(type) {
        if (type.toLowerCase() === "canvas") {
                var canvas = document.createElementOverride(type);
                if (typeof FlashCanvas != "undefined") {
                        FlashCanvas.initElement(canvas);
                }
                return canvas;
        } else { // other nodes
                return document.createElementOverride(type);
        }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris McCormick  
View profile  
 More options Aug 19 2011, 8:59 pm
From: Chris McCormick <ch...@mccormick.cx>
Date: Sat, 20 Aug 2011 08:59:58 +0800
Local: Fri, Aug 19 2011 8:59 pm
Subject: Re: [flashcanvas] hijacking document.createElement makes life easier
Hi Michael,

Cool trick! Thanks for sharing this.

Cheers,

Chris.

-------------------
http://mccormick.cx

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »