<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: John</title>
    <description>The latest articles on DEV Community by John (@john_phillips).</description>
    <link>https://dev.to/john_phillips</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1947831%2Fdea18f2a-1f50-4c39-98b9-2a6731c32c1e.png</url>
      <title>DEV Community: John</title>
      <link>https://dev.to/john_phillips</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/john_phillips"/>
    <language>en</language>
    <item>
      <title>Which Free Userscript Managers Support Organizing Scripts into Folders or Profiles?</title>
      <dc:creator>John</dc:creator>
      <pubDate>Wed, 21 Aug 2024 07:53:19 +0000</pubDate>
      <link>https://dev.to/john_phillips/which-free-userscript-managers-support-organizing-scripts-into-folders-or-profiles-3hid</link>
      <guid>https://dev.to/john_phillips/which-free-userscript-managers-support-organizing-scripts-into-folders-or-profiles-3hid</guid>
      <description>&lt;p&gt;I'm looking for a free userscript manager that allows organizing scripts into folders or profiles. For example, I have different scripts for enhancing browsing, boosting productivity, and even for online gaming &lt;a href="https://pokieslab.info/real-money-pokies/" rel="noopener noreferrer"&gt;like here&lt;/a&gt;. I've tried several options on Chrome, but none of these seem to offer the feature: TamperMonkey (both stable and beta versions), ViolentMonkey, Ace Script, and OrangeMonkey. Does anyone know of a solution that includes this functionality? Thanks in advance!&lt;/p&gt;

</description>
      <category>folders</category>
      <category>userscript</category>
      <category>help</category>
    </item>
    <item>
      <title>Working with JSON Data in an HTML Environment</title>
      <dc:creator>John</dc:creator>
      <pubDate>Tue, 20 Aug 2024 10:17:17 +0000</pubDate>
      <link>https://dev.to/john_phillips/working-with-json-data-in-an-html-environment-3opg</link>
      <guid>https://dev.to/john_phillips/working-with-json-data-in-an-html-environment-3opg</guid>
      <description>&lt;p&gt;I’ve recently started using JSON in my web development projects and encountered an interesting issue while trying to integrate it with HTML using JavaScript. Specifically, I used the fetch function to retrieve JSON data, which worked great for logging the data in the console. However, I ran into some challenges when trying to display this data in an HTML input field. Instead of showing the actual data, it either displayed "undefined" or "[object Object]". I suspect this is due to asynchronous behavior, and I read that using async/await might solve this. However, this led to an error related to ES version 8, which has been difficult to troubleshoot since most of the resources are geared towards more complex projects. Below is the code I’m currently working with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br&gt;
&amp;lt;html lang="en"&amp;gt;&lt;br&gt;
&amp;lt;head&amp;gt;&lt;br&gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;&lt;br&gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;&lt;br&gt;
    &amp;lt;title&amp;gt;JSON Fetch Example&amp;lt;/title&amp;gt;&lt;br&gt;
    &amp;lt;link rel="stylesheet" href="json_example.css"&amp;gt;&lt;br&gt;
    &amp;lt;script src="json_example.js" defer&amp;gt;&amp;lt;/script&amp;gt;&lt;br&gt;
&amp;lt;/head&amp;gt;&lt;br&gt;
&amp;lt;body&amp;gt;&lt;br&gt;
    &amp;lt;input type="text" id="jsonInput" placeholder="JSON Data Here"&amp;gt;&lt;br&gt;
&amp;lt;/body&amp;gt;&lt;br&gt;
&amp;lt;/html&amp;gt;&lt;br&gt;
CSS File (json_example.css)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;css&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#jsonInput {&lt;br&gt;
    position: fixed;&lt;br&gt;
    top: 50%;&lt;br&gt;
    left: 50%;&lt;br&gt;
    transform: translate(-50%, -50%);&lt;br&gt;
    width: 400px;&lt;br&gt;
    height: 30px;&lt;br&gt;
    font-size: 16px;&lt;br&gt;
    padding: 5px;&lt;br&gt;
}&lt;br&gt;
JavaScript File (json_example.js)&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
javascript&lt;/p&gt;

&lt;p&gt;`document.addEventListener("DOMContentLoaded", function() {&lt;br&gt;
    const jsonUrl = '&lt;a href="http://localhost:8080/data/person.json" rel="noopener noreferrer"&gt;http://localhost:8080/data/person.json&lt;/a&gt;';&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch(jsonUrl)
    .then(response =&amp;gt; response.json())
    .then(data =&amp;gt; {
        console.log(data);
        document.getElementById("jsonInput").value = JSON.stringify(data);
    })
    .catch(error =&amp;gt; console.error('Error fetching JSON:', error));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;});&lt;br&gt;
JSON File (person.json)&lt;/p&gt;

&lt;p&gt;json&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
    "firstName": "Jane",&lt;br&gt;
    "lastName": "Doe",&lt;br&gt;
    "age": 25,&lt;br&gt;
    "city": "Los Angeles"&lt;br&gt;
}`&lt;/p&gt;

&lt;p&gt;The code fetches JSON data and displays it in the console without any problems. However, when attempting to insert this data into an HTML text input field, it either results in an "undefined" value or displays "[object Object]" rather than the desired JSON content. Using async/await to handle the asynchronous nature of the fetch might help, but it leads to compatibility issues with ES version 8.&lt;/p&gt;

&lt;p&gt;How can I properly display the JSON data within an HTML element like a text input field?&lt;br&gt;
What are the best practices for handling asynchronous operations when working with JSON in a basic web project?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
