Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 6c234f4

Browse files
committed
docs(examples): improve script tag example
1 parent ec15a30 commit 6c234f4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

examples/browser-script-tag/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,19 @@
3737
<h1>IPFS in the Browser</h1>
3838
<p>This page creates an IPFS node in your browser and drops it into the global Javascript namespace as <b><em style="background-color:#d7d6d6">node</em></b>. Open the console to play around with it.</p>
3939
<p>Note that opening two tabs of this page in the same browser won't work well, because they will share node configuration. You'll end up trying to run two instances of the same node, with the same private key and identity, which is a Bad Idea.</p>
40-
<div id="status">Node status: offline</div>
40+
<h1 id="status">Node status: offline</h1>
4141

4242
<h2>Some suggestions</h2>
4343

4444
<p>Try adding a new file:</p>
4545

4646
<code style="display:block; white-space:pre-wrap; background-color:#d7d6d6">
47-
node.files.add(new node.types.Buffer('Hello world!'), function (err, res) {
47+
node.files.add(new node.types.Buffer('Hello world!'), (err, res) => {
4848
if (err || !res) {
4949
return console.error('Error - ipfs files add', err, res)
5050
}
5151

52-
res.forEach(function (file) {
53-
console.log('successfully stored', file)
54-
})
52+
res.forEach((file) => console.log('successfully stored', file))
5553
})
5654
</code>
5755

0 commit comments

Comments
 (0)