The project is deployed to https://abtester.hiroinaprotagonist.workers.dev
The project definition is available in the PROJECT_REQS.md file.
This is an orientation to the coding style choices that I made for this project and to the comments and additional information that I am submitting with the code.
I looked through the examples in the template gallery and followed your generally observable conventions, as follows:
I used single quotes rather than double quotes to denote strings.
I left out all ending semicolons.
I capitalized narrative comments and ended them with a period.
Other style-related conventions that I followed:
In html code, I used double quotes in the code and single quotes to denote the string containing said code.
I used template literals to describe constructions that would have required using the + operator to concatenate a string.
//Denotes a permanent, generally narrative, comment.
// Denotes an auto-commented comment, generally diagnostic, designed to be easily un- and re-commented in blocks of commented and uncommented code using Ctrl-/, if that has a standard implementation in the reader's software.
Functions are commented in JSDoc style, although I did not create a JSDoc file.
If I copied, or copied and modified, a large block of code, I included a reference to the source of the original code above the block.
I have included a list of references at the very bottom of index.js. Those link to the template gallery resources that I found helpful. I thought that information might be useful to someone.
-
Deployed a single page website based on a randomly chosen URL from the provided JSON data. See https://abtester.hiroinaprotagonist.workers.dev/
-
Modified the web page's title, the main title on the page, the description paragraph on the page, and the text and URL of the Call to Action link on the page.
-
Set the initially chosen random URL to persist in a cookie so that the user sees that variant of the site depending on their Do Not Track settings, as specified in 4. The user must visit the site once every 30 days or the cookie will expire.
-
Extended the implementation of the cookie so that the application either sets, does not set, or removes the cookie based on the browser's Do Not Track setting (retrieved from the appropriate header). This feature works as expected in the tested versions of Firefox and Chrome. It works in Microsoft Edge, but requires a restart after changing the Do Not Track setting in order to properly set (or remove) the cookie.
-
Added text to the description paragraph on the page that indicates whether or not the browser has Do Not Track enabled and is, or is not, using cookies.
I do not have a registered domain or zone, so I did not implement that feature.
Works as expected in the following browsers:
- Firefox 75.0 64-bit
- Microsoft Edge 44.18362.449.0 (See notes at item 4 of Work Completed)
- Chrome Version 81.0.4044.113 (Official Build) (64-bit)
Resolve browser warnings about document type (Edge) and encoding (Firefox).
Add error handling, especially to the gatherResponse function.
This was a great exercise. I learned a lot, was challenged a bit, and I am excited to be in this application process and even more excited to potentially become a Cloudflare intern.
Have a wonderful day.