Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6984199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:31:06+00:00 2026-05-27T18:31:06+00:00

I am trying to generate a url for the canvas. Here are the steps

  • 0

I am trying to generate a url for the canvas. Here are the steps I followed:

var can = document.getElementsByTagName("canvas");
var src = can.toDataURL("image/png");

When I tried running the above code on firebug it throws an error :

TypeError: can.toDataURL is not a function

I am running firefox 8 on ubuntu.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:31:08+00:00Added an answer on May 27, 2026 at 6:31 pm

    getElementsByTagName returns a NodeList [docs], not a single element.

    Simply access the first element of the list:

    var src = can[0].toDataURL("image/png");
    

    If you want to get the data URL for each canvas, then you have to iterate over the list. Otherwise, giving the canvas an ID and retrieving the reference with getElementById might be more convenient.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an issue trying to generate rss. I followed all the steps of
This is what I'm trying to generate: <div class=marker style=background:transparent url('/myApp/faces/javax.faces.resource/1.png?ln=images/map') no-repeat center top;></div>
I'm trying to generate some url 'slugs' for my website. It's based upon a
I am trying to generate a URL that contains a UNC path as one
I am trying to understand crc32 to generate the unique url for web page.
I trying to generate an XML document which is around 23 to 30 MB,
I'm trying to generate a chart via the following url: http://chart.apis.google.com/chart?chxl=0:|Mon|Tue|Wed|Thu|Fri|Sat|Sun&chxt=x&chbh=a,6,10&chs=320x225&cht=bvg&chco=A2C180&chds=0,95&chd=t:0,0,300,500,0,0,0&chtt=Test The values are
I'm trying to dynamically generate root folder in a url that's in the body
I am trying to dynamically generate JavaScript with just a URL get request. I
I am trying to generate an URL for my pdf file stored on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.