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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:03:53+00:00 2026-05-20T06:03:53+00:00

I’m trying to write a little bookmarklet that can extract some text from the

  • 0

I’m trying to write a little bookmarklet that can extract some text from the active page and load that into the clipboard.

The extraction is easy enough, but I’m really stuck doing the clipboard-copying part. Currently, I’m just alerting the text and hitting Ctrl+C to copy the text from the message-box, which isn’t ideal.

I’ve read How to Copy to Clipboard in JavaScript and other questions that suggest I use zeroclipboard, but I have no idea how one would make that work from a bookmarklet, considering I have to load external flash and javascript resources to be able to use the library.

I have no issues with messing up the page’s DOM to accomplish this or having to enable some permissions on my browser (Google Chrome), considering this is just a private bookmarklet.

Any pointers would be 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-05-20T06:03:54+00:00Added an answer on May 20, 2026 at 6:03 am

    A couple disclaimers:

    1. I’m not trying to spam you
    2. I gain nothing if you choose to use this

    I made a bookmarklet generator a while back to make it easier for me to create bookmarklets.

    It’s jQuery enabled, but that doesn’t mean you have to use jQuery.

    You can check out the source to see how to import another script/library into a page via a bookmarklet.

    In particular, the lines that import jQuery:

    if (!window.zbooks)
      {
        //if zbooks hasn't been set, initialize it
    
        //s used for the Script element
        var s = document.createElement('script');
        //r used for the Ready state
        var r = false;
        //set the script to the latest version of jQuery
        s.setAttribute('src', 'http://code.jquery.com/jquery-latest.min.js');
        //set the load/readystate events
        s.onload = s.onreadystatechange = function()
        {
    /**
     * LOAD/READYSTATE LOGIC
     * execute if the script hasn't been ready yet and:
     * - the ready state isn't set
     * - the ready state is complete
     *   - note: readyState == 'loaded' executes before the script gets called so
     *     we skip this event because it wouldn't have loaded the init event yet.
     */
          if ( !r && (!this.readyState || this.readyState == 'complete' ) )
          {
            //set the ready flag to true to keep the event from initializing again
            r = true;
            //prevent jQuery conflicts by placing jQuery in the zbooks object
            window.zbooks = {'jQuery':jQuery.noConflict()};
            //make a new zbook
            window.zbooks[n] = new zbooks(c);
          }
        };
        //append the jQuery script to the body
        b.appendChild(s);
      }
    

    I hope that helps.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,

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.