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


Groups > comp.lang.python > #81790

Re: Cherrypy - prevent browser "prefetch"?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python.list@tim.thechases.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'element': 0.07; 'javascript,': 0.07; 'ugly': 0.07; 'subject:Cherrypy': 0.09; '(other': 0.16; '-tkc': 0.16; '12:50': 0.16; "can't.": 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'received:10.216': 0.16; 'tag,': 0.16; 'tends': 0.16; 'wrote:': 0.18; 'input': 0.22; "shouldn't": 0.24; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'generally': 0.29; 'dec': 0.30; 'run': 0.32; 'style': 0.33; 'knowledge': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; 'should': 0.36; 'received:10': 0.37; 'button': 0.38; 'rich': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'itself': 0.39; 'visual': 0.39; 'to:addr:python.org': 0.39; 'break': 0.61; 'browser': 0.61; 'difficulty': 0.68; 'request.': 0.70; '2014,': 0.84; 'batchelder': 0.84
X-Sender-Id wwwh|x-authuser|tim@thechases.com
X-Sender-Id wwwh|x-authuser|tim@thechases.com
X-MC-Relay Neutral
X-MailChannels-SenderId wwwh|x-authuser|tim@thechases.com
X-MailChannels-Auth-Id wwwh
X-MC-Loop-Signature 1417488451608:1790308995
X-MC-Ingress-Time 1417488451608
Date Mon, 1 Dec 2014 20:50:00 -0600
From Tim Chase <python.list@tim.thechases.com>
To python-list@python.org
Subject Re: Cherrypy - prevent browser "prefetch"?
In-Reply-To <60102F31-5184-4FFF-B99E-23A5B0313399@ravnalaska.net>
References <6B74D6DD-A597-4BCF-8586-D0A56C9CDB77@ravnalaska.net> <20141201152608.09ca6f13@bigbox.christie.dr> <m5inqh$kdt$1@ger.gmane.org> <60102F31-5184-4FFF-B99E-23A5B0313399@ravnalaska.net>
X-Mailer Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu)
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-AuthUser tim@thechases.com
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16482.1417488456.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417488456 news.xs4all.nl 2896 [2001:888:2000:d::a6]:52342
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81790

Show key headers only | View raw


On 2014-12-01 13:14, Israel Brewster wrote:
> On Dec 1, 2014, at 12:50 PM, Ned Batchelder <ned@nedbatchelder.com>
>> The way to indicate to a browser that it shouldn't pre-fetch a
>> URL is to make it a POST request.
> 
> Ok, that makes sense. The only difficulty I have with that answer
> is that to the best of my knowledge the only way to make a HTML
> link do a POST is to use the onclick function to run a javascript,
> while having the "link" itself point to nothing.

Well, generally one would use a form where the method=POST and then
the button/input submits it:

 <form action="/path/to/my/url/" method="POST">
  <input type="submit">This is an input<input>
 </form>

or

 <form action="/path/to/my/url/" method="POST">
  <button type="submit">This is a <strong>button</strong></button>
 </form>

The advantage of a <button> is that it can contain rich content
(other markup) while an <input type="submit"> can't.

To do a POST via an <a> tag, you do need (as you mention) to do some
ugly jiggery with JavaScript, but tends to break the mental model.
You should be able to style a <button> element to look much like a
link if you find the visual effect of a <button> unpleasant.

-tkc

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Cherrypy - prevent browser "prefetch"? Tim Chase <python.list@tim.thechases.com> - 2014-12-01 20:50 -0600

csiph-web