Summary: producingtechnology.com/browser.html
Loaded SRC_URL
https://producingtechnology.com/65-apps/jinyouzhu_181989_15200447_cosmic-quest.html
Host page behavior (TERMINAL_VIEWER)
Same as before: terminal-styled chrome, PREV / RANDOM / NEXT, an iframe for the selected URL, LOADED_SRC
and PAGE: i/n
. RANDOM picks a random entry from the baked-in list; the first load uses index 0 until you randomize.
Embedded app behavior (Cosmic Quest)
A space-themed mission console
dashboard. It defines embedded fallback JSON in the page (app name, version, users, missions, achievements, leaderboard, settings, developer). On load (and when Reload Galactic Data is clicked), it first parses that embedded object and renders: header pills, user cards (level, credits, premium flag), mission cards (difficulty badge, reward, completed status), a leaderboard table, achievement chips, read-only settings rows (sound, notifications, difficulty mode), and a developer credit line. It then tries to fetch live data from
https://producingtechnology.com/a1/15-json/yj578.json.
If the response is OK, it re-renders from the network payload using a flexible parsePayload helper (alternate key names for each section). If the fetch fails, it keeps the embedded render and updates the status line accordingly.
What did not work as expected
-
The live JSON URL currently returns a 404 HTML error page, not JSON, so the app always falls back to embedded data in practice (the catch path). That makes
live sync
and the reload button misleading until the URL or server path is fixed. - Several strings in the script use broken characters (premium badge, mission completed/incomplete labels), typical of a UTF-8 / encoding mismatch in the source file.
-
loadDatasets loading state and status messages in a slightly confusing sequence (e.g. rapid transitions betweenLoading embedded…
andAttempting live sync…
), which can feel glitchy even when things work. -
Settings use visual
switch
elements that are not interactive; they only reflect JSON values, which is easy to mistake for real toggles.
Prompt to improve the app
Point
DATA_URLat the real deployed JSON for this assignment (matching the student netid / filename convention used elsewhere on producingtechnology.com), verifyresponse.okandContent-Typebeforeresponse.json(), and if the body is HTML or parse fails, show a clearInvalid JSONmessage with the status code. Re-save the file as UTF-8 and replace garbled symbols in templates. SimplifyloadDatato one loading state machine (loading → success from network OR fallback with explicit reason). Either make settings toggles functional with local state or mark them as read-only (e.g.aria-disabled/Preview only). Optionally merge embedded data with partial network data when fields are missing.