Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30963

Re: [Browser] How to replace strings in a URL with a javascript boormarklet?

Newsgroups comp.lang.javascript
Date 2016-07-22 18:13 -0700
References (6 earlier) <a52bb885-677d-45c2-b6d7-6d724603ec02@googlegroups.com> <nmqi7t$8ul$1@dont-email.me> <nmqj40$bba$1@dont-email.me> <a24b5bf3-1345-443a-8214-f80f921ae899@googlegroups.com> <XnsA64DED5FCE72Beejj99@194.109.6.166>
Message-ID <93e6c052-f2bc-445a-9bb6-23795cd70610@googlegroups.com> (permalink)
Subject Re: [Browser] How to replace strings in a URL with a javascript boormarklet?
From arpegiateur@gmail.com

Show all headers | View raw


On Friday, July 22, 2016 at 10:20:56 PM UTC+1, Evertjan. wrote:
> 
> So you do nothing with the 'result' variable.
> 
> > javascript:(function
> > decode(t){location.href=decodeURIComponent(t.value.replace(/^.*(http)/,'$
> > 1'));}); 
> 
> So you do not call the function, so it cannot execute.
> 
> > javascript:location.href=decodeURIComponent(t.value.replace(/^.*(http)/,'
> > $1')); 
> 

I may have tried this one too:
   javascript:decodeURIComponent(location.href.replace(/^.*(http)/,'$1'));

 ... which is probably wrong with the wrong syntax, but with the right idea.

To be honest I was just putting parts from other javascript bookmarklets into your code in 'unholly ways', mixing with some lightning and hoping in the end I could say "It's alive!" :P :D



> Indeed, but to understand it, please first look at this one:
> 
> javascript:location.href='http://cnn.com/';
> 
> or even better use the console [F12] and there enter:
> 
> location.href='http://cnn.com/';
> 
In the console it says that is about to exit the current page and go to CNN, after I authorize the copy-paste function in the console.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-18 13:42 -0700
  Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-18 23:24 +0200
    Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-19 08:10 -0700
      Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-19 19:49 +0200
        Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-19 13:34 -0700
          Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-20 09:39 +0200
            Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-20 10:09 -0700
              Re: [Browser] How to replace strings in a URL with a javascript boormarklet? Osmo Saarikumpu <osmo@weppipakki.com> - 2016-07-21 16:21 +0300
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? Osmo Saarikumpu <osmo@weppipakki.com> - 2016-07-21 16:36 +0300
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-22 12:19 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-22 23:20 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-22 18:13 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-23 12:02 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-26 11:49 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-27 00:20 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-28 08:07 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-28 19:24 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-28 14:44 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-29 00:29 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-30 07:53 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-30 17:59 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-08-03 08:03 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-08-03 10:05 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-08-03 23:38 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-08-04 13:09 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-08-04 22:37 +0200
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-08-05 10:54 -0700
                Re: [Browser] How to replace strings in a URL with a javascript boormarklet? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-08-05 20:31 +0200
  Re: [Browser] How to replace strings in a URL with a javascript boormarklet? Aleksandro <aleksandro@gmx.com> - 2016-07-19 15:45 -0400
    Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-19 13:40 -0700
    Re: [Browser] How to replace strings in a URL with a javascript boormarklet? arpegiateur@gmail.com - 2016-07-19 13:41 -0700

csiph-web