-
Notifications
You must be signed in to change notification settings - Fork 7
Description
On the "Introduction" page it says:
The easiest way to try out RE:DOM is using the JSFiddle Hello World example. Feel free to open it in another tab...
A link would be really useful here. I searched for it on the net and found a whole bunch of links. I followed what seemed to be the purest one and ended up with something that has three different parts to edit. I do not understand how this site works.
The "Introduction" page also says:
Or, you can create an index.html file...
As a low level programmer who likes to understand exactly what is going into a program and how that seemed more my speed. After reading the "Elements" page, and taking everything very literally (low level programmer, remember) this is what I ended up with:
<script src="https://redom.js.org/redom.min.js"></script>
<script>
import { el, mount } from "redom";
const hello = el("h1", "Hello world!");
mount(document.body, hello);
</script>
This, when loaded in a browser gives a blank page. So, OK, perhaps I am taking things a bit too literally. Let's wrap it all in an 'html' and 'body' tag. Here's what I got:
<!DOCTYPE html>
<html lang="en" class="antialiased">
<body class="font-sans font-normal text-gray-700 leading-normal">
<script src="https://redom.js.org/redom.min.js"></script>
<script>
import { el, mount } from "redom";
const hello = el("h1", "Hello world!");
mount(document.body, hello);
</script>
</body>
</html>
I then looked at the TodoMVC example. It doesn't even load redom as described in the "Introduction" page. It somehow still works in JSFiddle. I reworked it by wrapping the javascript bit in 'script' tags and putting it in the HTML section of JSFiddle, and satisfied that still worked, copied it to my html file. Which gives a blank screen in my browser. RE:DOM is not much good if it only works in JS Fiddle. I really need to get it working inmy browser from a plain file.
I am not a javascript programmer. I have programmed in javascript before, but by taking full and complete working examples and tweaking them to do what I want, and when I get stuck I search online for examples of what I want to do and because they are also full and complete I can see how to extract what I need from the example and insert it in my code.
It would be really good if the guide provided a complete "hello world" example as a standalone index.html that people can copy to their hard drive and open in their browser as a file:: URL.