From: Kevin Carhart <kevin@carhart.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] data-* attributes
Date: Wed, 22 Nov 2017 00:43:04 -0800 (PST) [thread overview]
Message-ID: <alpine.LRH.2.03.1711220020230.20270@carhart.net> (raw)
In-Reply-To: <20171016072958.eklhad@comcast.net>
Thanks for the recent message about the tidy changes.
Karl, you asked about the site oranges.com and said links aren't working
and they used to.
There is something going on with the attribute data-source, and more
generally maybe with data-* attributes, which are part of html5.
A link in oranges looks like..
<a href="/wine-basket"
data-source="a1b9910284ad8c677b8d3ec4b464ce6ebbd0e6c7f8d8ead8b20bb80596edf86d1fa76d1417b2ca95bfd19c3ab9ff0bf6f9f98fbd283bd71e4e36b34ae70d2b852c6c61f8bc9cc7cfb33613393216eda8253513da19f726536504e22590e7d2b783a2e6357490c911d5fcab6b21cc911149047db90ccfdea7">Wine
Basket</a>
And the javascript later wants to reference:
$(this).attr("data-source")
Where this is the link that has just been clicked.
But that attribute isn't there, so it can't read/write its value to a
cookie, namely a hash corresponding to a given link destination. (I dunno
what was wrong with plain hyperlinks but that's what they use.)
I think tidy knows about these attributes, because they are referenced in
the tidy file attrs.c
So maybe we want to make a change in decorate.
I wonder what's missing. Maybe something in decorate. Should attributes
beginning with data-* be hardcoded, or should any arbitrary name-value
pair be passed along and use Attributes as a catch-all?
Here's the relevant function. It is document.scripts[2].data
$(function() {
$("a").click(function() {
document.cookie = "_utms=" +
($(this).attr("data-source") ? $(this).attr("data-source") :
"a1b9910284ad8c677b8d3ec4b464ce6ebbd0e6c7f8d8ead8b20bb80596edf86d1fa76d1417b2ca951a0ccb450672500b")
+ "; path=/";
});
$("form").submit(function() {
document.cookie = "_utms=" +
($(this).attr("data-source") ? $(this).attr("data-source") :
"a1b9910284ad8c677b8d3ec4b464ce6ebbd0e6c7f8d8ead8b20bb80596edf86d1fa76d1417b2ca951a0ccb450672500b")
+ "; path=/";
});
});
K
Date: Sun, 19 Nov 2017 08:32:43
From: Karl Dahlke <eklhad@comcast.net>
To: kevin@carhart.net
Subject: www.oranges.com
The links on this page don't work, and I'm pretty sure they use to.
Line 113 {The Color Orange} {Wine Basket} etc
Just make a note of it if we don't have time to investigate right now.
Karl Dahlke
next prev parent reply other threads:[~2017-11-22 8:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 12:29 [Edbrowse-dev] Tidy error reporting Karl Dahlke
2017-11-22 8:43 ` Kevin Carhart [this message]
2017-11-22 9:33 ` [Edbrowse-dev] data-* attributes Kevin Carhart
2017-11-22 15:48 ` Karl Dahlke
2017-11-22 21:36 ` Kevin Carhart
2017-11-23 1:23 ` Kevin Carhart
2017-11-24 21:19 ` Karl Dahlke
2017-11-25 0:20 ` [Edbrowse-dev] data-* attributes / new work on RC Kevin Carhart
2017-11-25 0:56 ` Karl Dahlke
2017-11-25 1:15 ` Kevin Carhart
2017-11-25 1:22 ` Karl Dahlke
2017-11-25 1:44 ` Kevin Carhart
2017-11-25 2:28 ` Karl Dahlke
2017-11-25 3:10 ` Kevin Carhart
2017-11-25 5:02 ` Karl Dahlke
2017-11-25 5:35 ` Kevin Carhart
2017-11-26 13:14 ` Karl Dahlke
2017-11-27 1:03 ` Kevin Carhart
2017-11-27 1:48 ` Kevin Carhart
2017-11-27 2:58 ` Karl Dahlke
2017-11-27 3:37 ` Kevin Carhart
2017-11-26 22:43 ` Karl Dahlke
2017-11-27 3:19 ` Kevin Carhart
2017-11-27 4:23 ` Karl Dahlke
2017-11-27 4:51 ` Kevin Carhart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LRH.2.03.1711220020230.20270@carhart.net \
--to=kevin@carhart.net \
--cc=Edbrowse-dev@lists.the-brannons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).