Skip to content

Commit

Permalink
Update the title after loading
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Yuan <[email protected]>
  • Loading branch information
juntao committed Sep 28, 2024
1 parent a59976e commit 530b8d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<link href="sample.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<style>
.share-btn {
text-align: center;
}
.share-btn > a {
display: inline-block;
border: 1px solid #000080;
Expand Down Expand Up @@ -44,7 +47,7 @@
console.log(data);
if (data['status']) {
document.title = data["subject"];
document.getElementById('share-btn').setAttribute('data-title', data["subject"]);
window.ShareButtons.update();
document.getElementById("subject").innerHTML = data["subject"];
document.getElementById("body").innerHTML = "<b><i>" + data["question"] + "</i></b><br>" + marked.parse(data["body"]);
} else {
Expand Down

0 comments on commit 530b8d2

Please sign in to comment.