webassembly-examples icon indicating copy to clipboard operation
webassembly-examples copied to clipboard

Webassembly pages use examples that are blank pages

Open seumoo opened this issue 3 years ago • 3 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table

What specific section or headline is this issue about?

Examples

What information was incorrect, unhelpful, or incomplete?

The Examples section for multiple Webassembly pages use HTML or live samples as references. The live samples are blank and users may assume the samples are not working. The samples are working since they use console logs, however, this is not obvious.

What did you expect to see?

A line on the HTML page that says "Please open your Developer Console to see console logs based on the Example".

Do you have any supporting links, references, or citations?

The following pages have this issue (not a comprehensive list):

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/webassembly/validate https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/webassembly/table/table https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/webassembly/table/get https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/webassembly/table https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/webassembly/module/customsections https://mdn.github.io/webassembly-examples/js-api-examples/index-compile.html https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/webassembly/memory/memory

Do you have anything more you want to share?

No response

seumoo avatar May 22 '22 23:05 seumoo

Yes, I agree. It might be even nicer (although more work) for examples like this to update some kind of in-page log, like for instance https://developer.mozilla.org/en-US/docs/Web/API/UI_Events#keyboard_and_input_events , so people can see the output without needing to open the developer tools.

wbamberg avatar May 23 '22 00:05 wbamberg

@bsmth I don't think this is still an issue anymore. These pages don't have live examples.

MendyBerger avatar Sep 25 '25 13:09 MendyBerger

@bsmth I don't think this is still an issue anymore. These pages don't have live examples.

Sorry I forgot to leave a note after moving this. Right, the pages are updated, but we have this file linked to from prose:

https://mdn.github.io/webassembly-examples/js-api-examples/index-compile.html

So I think we can fix by including a H1 and a para in the example explaining what visitors are looking at.

https://github.com/mdn/webassembly-examples/blob/main/js-api-examples/index.html#L10

bsmth avatar Sep 25 '25 14:09 bsmth