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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:05:26+00:00 2026-05-23T08:05:26+00:00

I am trying to make a bookmarklet for my website. I have made a

  • 0

I am trying to make a bookmarklet for my website.

I have made a php page that when sent a GET for example www.website.com/index.html?a=banana it will return echo 'stand';

Now I am trying to make a bookmarklet that when I press it will:
Do the GET to the php page, then display whatever the echo was back to the user in a small popup that disapears after 3 seconds.

How can I do this?

Instapaper bookmarklet does it…

javascript:
function%20iprl5(){
  var%20d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;
  try{
    if(!b)
      throw(0);
    d.title='(Saving...)%20'+d.title;
    z.setAttribute('src',l.protocol+'//www.instapaper.com/j/deyNbbpjuSei?u='+encodeURIComponent(l.href)+'&t='+(new%20Date().getTime()));
    b.appendChild(z);
  }
  catch(e){
    alert('Please%20wait%20until%20the%20page%20has%20loaded.');
  }
}
iprl5();
void(0)
  • 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-23T08:05:27+00:00Added an answer on May 23, 2026 at 8:05 am

    A bookmarklet is a piece of javascript that runs in the scope of the page you are on.

    It is not meant to just call arbitrary urls and cannot do so since that would be in violation of same origin practice. If your PHP can return JSONP, then you can write a bookmarklet that will insert a script on the page that envokes the script you return – that would be able to display a popup too

    javascript:
    function%20iprl5(){
      var%20d=document; // shorten document object
      var z=d.createElement('scr'+'ipt'); // create a script tag
      var b=d.body; // get document.body
      var l=d.location; // get document.location - I would get document.URL instead
      try{
        if(!b) throw(0); // if there is no body object available
        d.title='(Saving...)%20'+d.title; // set document.title
        z.setAttribute('src',l.protocol+'//www.yourserver.com/test.php?u='+encodeURIComponent(l.href)+'&time='+(new%20Date().getTime())); // create the script url
        b.appendChild(z); // append it to the body - I would append to head myself
      }
      catch(e){ // give an error
        alert('Please%20wait%20until%20the%20page%20has%20loaded.');
      }
    }
    iprl5(); // call it
    void(0); // make sure it does not return a value to the window
    

    paste this view-source:http://www.instapaper.com/j/deyNbbpjuSei?u=http://www.stackoverflow.com into the location bar to see the amount of stuff returned as part of the page you are on

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

Sidebar

Related Questions

I am trying to make a bookmarklet that when clicked will check the URL
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I'm trying to make a JavaScript bookmarklet that will act as a highlighter, changing
I'm trying to make a snippet of javascript that can get a list of
Im trying make first person camera in my project. I followed this tutorial http://www.morrowland.com/apron/tutorials/gl/gl_camera_3b.zip
I am trying to make a bookmarklet that opens a popup window. Inside this
I'm trying to make a bookmarklet that does something similar to what Instapaper's does.
I am currently trying to make a bookmarklet that adds, among other things, a
I am trying to make a bookmarklet that will return a user id for
I'm trying to make a bookmarklet that will take the URL of the current

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.