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

  • SEARCH
  • Home
  • 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 8693911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:39:15+00:00 2026-06-13T00:39:15+00:00

I use the jcanvas plugin for my 2d tagcloud research. I wish that I

  • 0

I use the jcanvas plugin for my 2d tagcloud research.
I wish that I could paint several tags on canvas and each of them links to a different page.
So, I need a for loop to show the tags,
Here is my code.

 for(i=1;i<=5;i++){

    $("canvas").drawText({
      layer: true,
      fillStyle: "#9cf",
      strokeStyle: "#000",
      strokeWidth: 1,
      x: 100, y: 30*i,
      text: "tag"+i,
      font: "20pt 'Trebuchet MS', sans-serif",

      // Event bindings
      mouseover: function() {
        $("canvas").css({cursor: "pointer"});
      },
      mouseout: function() {
        $("canvas").css({cursor: "default"});
      },
      // Click link to open it
      click: function(layer) {
        window.open("http://www.google.com/?"+i);
      }
    });
 }

But it turns out every tags links to the same url, that is not the result I expect.
Anyone here could help me ! thx a lot !!!

you can test it in here.

  • 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-06-13T00:39:17+00:00Added an answer on June 13, 2026 at 12:39 am

    Add property id (or any other name) and change function.
    ...
    font: "20pt 'Trebuchet MS', sans-serif",
    id: i,
    ...
    click: function(data) {
    window.open("http://www.google.com/?"+data.id);
    }

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

Sidebar

Related Questions

I have a canvas and I use jCanva (http://calebevans.me/projects/jcanvas/docs.php?p=layers)s to create circles with events.
Use scenario is pretty simple: I have a desktop only application that could be
I'm using jCanvas to paint on a HTML canvas element. First I initialize a
I have a canvas (with width and height) and I use JCanvas to draw
Use a Content Delivery Network (CDN) Compress components with gzip Configure entity tags (ETags)
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
Use case: I find a piece of code that I do not understand at
use case example I have a servlet that is receiving login requests. If a
use WWW::Mechanize; my $mech = WWW::Mechanize->new; $mech->get( $url ); say $mech->text; How could I
use case is simple: I want to run some boiler plate code before each

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.