A new request with request id 18377 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is :
Title : Koha-devel Digest, Vol 186, Issue 5
Category :
Description : Send Koha-devel mailing list submissions to
koha-devel@lists.koha-community.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
or, via email, send a message with subject or body 'help' to
koha-devel-request@lists.koha-community.org
You can reach the person managing the list at
koha-devel-owner@lists.koha-community.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Koha-devel digest..."
Today's Topics:
1. Embedding JSON data in HTML (dcook@prosentient.com.au)
----------------------------------------------------------------------
Message: 1
Date: Wed, 5 May 2021 14:07:11 +1000
From: <dcook@prosentient.com.au>
To: <koha-devel@lists.koha-community.org>
Subject: [Koha-devel] Embedding JSON data in HTML
Message-ID: <05a501d74164$1f87af80$5e970e80$@prosentient.com.au>
Content-Type: text/plain; charset="utf-8"
Hi all,
I was just reflecting on bugs like
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26942 and
reviewing https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
when I saw the following method for embedding JSON in HTML:
<!-- Generated by the server -->
<script id="data" type="application/json">{"userId":1234,"userName":"John
Doe","memberSince":"2000-01-01T00:00:00.000Z"}</script>
<!-- Static -->
<script>
const userInfo = JSON.parse(document.getElementById("data").text);
console.log("User information: %o", userInfo);
</script>
I thought that was neat.
David Cook
Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20210505/556945a5/attachment-0001.htm>
------------------------------
Subject: Digest Footer
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/
------------------------------
End of Koha-devel Digest, Vol 186, Issue 5
******************************************
NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.