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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:47:25+00:00 2026-06-05T08:47:25+00:00

I have set up links that when clicked I want it to copy the

  • 0

I have set up links that when clicked I want it to copy the text. It outputs many links so I have to make sure zClip copies the right one:

<a class="copy-callbacks" id="coupon-code-copy-<?php echo $couponid ; ?>" href="#"><?php echo $info['coupon'] ; ?></a>

This is the jQuery I am using but it is not working:

$(document).ready(function(){

    $("a.copy-callbacks").zclip({
        path:'scripts/ZeroClipboard.swf',
        copy: $('#' + myCopyID).text(),
        beforeCopy:function(){
            var myCopyID = $(this).attr("id");  
        },
        afterCopy:function(){
        }
    });

});

Using this code the flash object doesn’t even load. I’m not quite sure what is going wrong. I’ve tried using:

copy: $(this).text(),

The flash object loads, but for some weird reason it copies some text in the footer. Any help is greatly appreciated!!

  • 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-05T08:47:27+00:00Added an answer on June 5, 2026 at 8:47 am

    I’ve never had to use the .attr(“id”), I always do the following.

    <span class="swfTitle" style="position: relative; onmouseover="this.style.cursor='pointer'">
        Text
    </span>
    
        $('.swfTitle').zclip({
        path: '/js/ZeroClipboard.swf',
        copy: function () {
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                async: false,
                data: JSON.stringify(PageInfo),
                url: "dosomethinghere.aspx&query=string",
                timeout: 30000,
                success: function (data) {
                    PageInfo = JSON.parse(data);
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(thrownError);
                }
            });
      return PageInfo.PostHTML;
      }
    

    Where PageInfo is a js object. Overall, id tags are different than the class tags, .swfTitle is different than #swfTitle.

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

Sidebar

Related Questions

I have a set of links and their corresponding divs showing information when clicked.
I have a set of text inputs with a link to the right of
So i have a set of links that all must call the same ajax
I have a page with multiple tabs set up with links that have corresponding
I have a couple of html links, that I have onmouseover and onmouseout set
I have a set of lines that define a W shape. On each line
I have set the eclipse java formatter to wrap lines that exceed 120 characters
It is common to have a set of links in a footer represented in
I have a set of 28 links in a wrapper div element. Each one
In my main CSS file, I have my a:link selector set to display links

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.