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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:27:35+00:00 2026-05-16T21:27:35+00:00

Is it possible to load remote JavaScript files from the address bar? I have

  • 0

Is it possible to load remote JavaScript files from the address bar?

I have been trying to put this into the address bar:

javascript:src='http://depot.com/file.js';funcname();

I’m not using this for bad things. I’m just testing my site, that’s all. If you wanted to protect your site you must learn to attack it first, right?

  • 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-16T21:27:36+00:00Added an answer on May 16, 2026 at 9:27 pm

    I guess you should be able to do the following:

    javascript:(function () {
      var newScript = document.createElement('script');
      newScript.type = 'text/javascript';
      newScript.src = 'http://depot.com/file.js';
      document.getElementsByTagName('body')[0].appendChild(newScript);
    })();
    

    Here’s a very useful example (paste this in your address bar):

    javascript:(function () {
      var newScript = document.createElement('script');
      newScript.type = 'text/javascript';
      newScript.src = 'http://cornify.com/js/cornify.js';
      document.getElementsByTagName('body')[0].appendChild(newScript);
    
      for (var i = 0; i < 5; i++) {
        newScript = document.createElement('script');
        newScript.type = 'text/javascript';
        newScript.src = 'http://cornify.com/js/cornify_run.js';
        document.getElementsByTagName('body')[0].appendChild(newScript);
      }
    })();
    

    Voila:

    Stack Overflow cornified

    In fact, this is how cornify.com is including the remote scripts in their bookmarklet.


    UPDATE:

    As @Ben noted in the other answer, it’s not that straightforward to call a function defined in your remote script. Ben suggests one solution to this problem, but there is also another solution, the one that cornify are using. If you check out http://cornify.com/js/cornify_run.js you’ll see that there’s just one function call in that file. You could place your funcname() call in a separate JavaScript file, as cornify are doing, because script blocks are guaranteed to be executed in the order they are inserted. Then you’d have to include both scripts, as in the following example:

    javascript:(function () {
      var newScript = document.createElement('script');
      newScript.type = 'text/javascript';
      newScript.src = 'http://depot.com/file.js';
      document.getElementsByTagName('body')[0].appendChild(newScript);
    
      newScript = document.createElement('script');
      newScript.type = 'text/javascript';
      newScript.src = 'http://depot.com/file_run.js';
      document.getElementsByTagName('body')[0].appendChild(newScript);
    })();
    

    Where the file_run.js simply includes a call to funcname().

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

Sidebar

Related Questions

Is it possible to load an html document into a DOM javascript object so
Is it possible to load an image from a remote server using ImageView.setImageURI(Uri uri)?
Is it possible to load a remote script and have it eval'ed? For example:
I am trying to load image from a remote server on the UIImageView in
I have a flash file where I load a remote SWF file into my
is it possible to load multiple swf files directly on top of each other?
Is it possible to load images from an array in jQuery? The array looks
Is it possible to load new lines from a text file to variables in
Is it possible to load a single plugin from outside the cake root using
In modern processors it is possible to load a register from memory and then

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.