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 1110285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:22:20+00:00 2026-05-17T02:22:20+00:00

I don’t know if this is to do with Raphael, ColorBox or jQuery. Here’s

  • 0

I don’t know if this is to do with Raphael, ColorBox or jQuery. Here’s my the relevant code:

var image = paper.image(p.url_, tx, ty, img.width, img.height);
image[0].style.cursor = "pointer";
image.node.onclick = function() {
    $.colorbox({
        title: "Some Random Title",
        href: function() {
            $.post("test.php", { arg: p.id_ } );
        }
    });
};      

When watching the click in FireBug console the post is fired twice. It is also fired twice if it is a get as well.

If I change from the href function to a direct call of test.php then there is only a single get issued.

Why is the click event issuing the call twice when using jQuery?

UPDATE: Adding a call to alert in the anonymous function also fires twice so I guess it is something to do with colorbox.

UPDATE 2: Just tried wiring it to an actual page and FireBug spits this error message out in addition to the two get/posts. Which confirms this is a problem in ColorBox. Also it makes progress hard because while both calls complete colorbox sits showing it’s throbber.

c is undefined 
    (function(b,gb){var v="none",t="click"...c.settings=eb;b(c.init)})(jQuery,this)

Note: This only attached to the second call and not the first.

  • 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-17T02:22:20+00:00Added an answer on May 17, 2026 at 2:22 am

    Not terribly familiar with colorbox so I am going out on a limb here. I’m guessing you want colorbox’s html to use the result of the post. I would put the post outside of color box. Is there any reason you aren’t using $(image.node).click()? Or even $(image).click()? Here’s how I would do it

    var image = paper.image(p.url_, tx, ty, img.width, img.height);
    image[0].style.cursor = "pointer";
    $(image.node).click(function() {
        var post_html = $.post("test.php", { arg: p.id_ } );
        $.colorbox({
            title: "Some Random Title",
            html: post_html
        });
    });
    

    This may not fix it, but it will tell you if the problem is that colorbox fires the href twice or if the click is being executed twice.

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

Sidebar

Related Questions

I don't know if anyone has seen this issue before but I'm just stumped.
I don't know if this is possible. I display a table of results and
I don't know if i am doing it right, this is what I got:
I don't know when to add to a dataset a tableadapter or a query
I don't understand where the extra bits are coming from in this article about
I don't expect a straightforward silver bullet answer to this, but what are the
Don't let below code scare you away . The question is really simple, only
Don't need to do this right now but thinking about the future... What would
Don't want to sort the entries. using this does not preserve the order as
I don't know why i can't match url when url is http://localhost:8000/home/CPM%201.6.1001 since i

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.