Discuss Scratch

kkidslogin
Scratcher
1000+ posts

advanced hahas

ninjaMAR wrote:

(#240)
How I debug code
print("Here")
...
print("Here1")
...
print("Here2")
...
print("Here3")
I mean, it works
Mr_rudy
Scratcher
100+ posts

advanced hahas

01110111 01101000 01100001 01110100 00100000 01100100 01101001 01100100 00100000 00110000 00100000 01110011 01100001 01111001 00100000 01110100 01101111 00100000 00111000 00101100 00100000 01101110 01101001 01100011 01100101 00100000 01100010 01100101 01101100 01110100



decode that
ninjaMAR
Scratcher
1000+ posts

advanced hahas

Mr_rudy wrote:

(#243)
01110111 01101000 01100001 01110100 00100000 01100100 01101001 01100100 00100000 00110000 00100000 01110011 01100001 01111001 00100000 01110100 01101111 00100000 00111000 00101100 00100000 01101110 01101001 01100011 01100101 00100000 01100010 01100101 01101100 01110100



decode that
what did 0 say to 8, nice belt
TheNintendoFan2020
Scratcher
1000+ posts

advanced hahas

Do you (Nintendo 64's Micro processor name but the last letter is gone and the first letter is replaced with d) your Nachos or eat them without (Nintendo 64's Micro processor name but the last letter is gone and the first letter is replaced with d)ping
INSERT-USER_NAME
Scratcher
1000+ posts

advanced hahas

i wrote an html editor
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>html editor</title>
    </head>
    <body>
        <textarea id="htmlIn">html go here</textarea>
        <div id="htmlrend"></div>
        <script>
            var txtBox = document.getElementById("htmlIn");
            var htmlDiv = document.getElementById("htmlrend");
            var rendHtml = function(e) {
                htmlDiv.innerHTML = txtBox.value
            };
            addEventListener("keydown", rendHtml);
        </script>
    </body>
</html>

Last edited by INSERT-USER_NAME (May 15, 2024 13:37:52)

BigNate469
Scratcher
1000+ posts

advanced hahas

INSERT-USER_NAME wrote:

i wrote an html editor
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>html editor</title>
    </head>
    <body>
        <textarea id="htmlIn">html go here</textarea>
        <div id="htmlrend"></div>
        <script>
            var txtBox = document.getElementById("htmlIn");
            var htmlDiv = document.getElementById("htmlrend");
            var rendHtml = function(e) {
                htmlDiv.innerHTML = txtBox.value
            };
            addEventListener("keydown", rendHtml);
        </script>
    </body>
</html>
I mean, it works, but a couple of tips:
let is more stable than var, but does not have support in systems running ES5 or earlier.
<textarea>s already render the text inside of them…

Also, how is this a joke?
your JavaScript may need debugging
INSERT-USER_NAME
Scratcher
1000+ posts

advanced hahas

BigNate469 wrote:

<textarea>s already render the text inside of them…
the function “htmlRend” is for tossing whatever is typed in the textarea into the htmlDiv's innerHTML so it makes some sort of live preview
It lags behind one key press for some reason, i'm not sure why, or how to get around this but pressing shift could be a workaround for the end-user

BigNate469 wrote:

Also, how is this a joke?
I found it funny how extremely simple it was to make
BigNate469
Scratcher
1000+ posts

advanced hahas

INSERT-USER_NAME wrote:

BigNate469 wrote:

<textarea>s already render the text inside of them…
the function “htmlRend” is for tossing whatever is typed in the textarea into the htmlDiv's innerHTML so it makes some sort of live preview
It lags behind one key press for some reason, i'm not sure why, or how to get around this but pressing shift could be a workaround for the end-user

BigNate469 wrote:

Also, how is this a joke?
I found it funny how extremely simple it was to make
Also, you might want to use .innerText or .textContent, because .innerHTML is susceptible to someone writing
<script>//Insert malicious JavaScript here</script>
And inserting code that could potentially lead to data breaches and server crashes.
INSERT-USER_NAME
Scratcher
1000+ posts

advanced hahas

BigNate469 wrote:

INSERT-USER_NAME wrote:

BigNate469 wrote:

<textarea>s already render the text inside of them…
the function “htmlRend” is for tossing whatever is typed in the textarea into the htmlDiv's innerHTML so it makes some sort of live preview
It lags behind one key press for some reason, i'm not sure why, or how to get around this but pressing shift could be a workaround for the end-user

BigNate469 wrote:

Also, how is this a joke?
I found it funny how extremely simple it was to make
Also, you might want to use .innerText or .textContent, because .innerHTML is susceptible to someone writing
<script>//Insert malicious JavaScript here</script>
And inserting code that could potentially lead to data breaches and server crashes.
it's really meant to be an overly simple html editor, not a text editor
you're meant to be able to make small webpages with it
dynamicsofscratch
Scratcher
1000+ posts

advanced hahas

WHO STOLE MY 4.15 BILLION TRANSISTORS?!
Mr_rudy
Scratcher
100+ posts

advanced hahas

Why did the Java developer quit his job? Because he didn't get arrays

(get it, like a raise)
dynamicsofscratch
Scratcher
1000+ posts

advanced hahas

TheNintendoFan2020 wrote:

(#245)
Do you (Nintendo 64's Micro processor name but the last letter is gone and the first letter is replaced with d) your Nachos or eat them without (Nintendo 64's Micro processor name but the last letter is gone and the first letter is replaced with d)ping
you literally wanted to ask if we dip our nachos or not? in the advanced hahas topic?
dynamicsofscratch
Scratcher
1000+ posts

advanced hahas

Mr_rudy wrote:

(#252)
Why did the Java developer quit his job? Because he didn't get arrays

(get it, like a raise)
Why didn't the C developer get the job? Because he was blind.

(get it, like he couldn't see/C)
alwayspaytaxes
Scratcher
500+ posts

advanced hahas

Mr_rudy wrote:

Why did the Java developer quit his job? Because he didn't get arrays

(get it, like a raise)
Why couldn't Haskell go to the fancy restaurant? Because he had no class
dynamicsofscratch
Scratcher
1000+ posts

advanced hahas

alwayspaytaxes wrote:

Mr_rudy wrote:

Why did the Java developer quit his job? Because he didn't get arrays

(get it, like a raise)
Why couldn't Haskell go to the fancy restaurant? Because he had no class
me tryna up that joke
dumorando
Scratcher
100+ posts

advanced hahas

stuupid nerds: avoid global namespace pollution!!!!
me:
let packages = await fetch("https://javascript.dumorando.com/packages.json").then(data => data.json())
packages.map(pkg => {
    let newscript = document.createElement("script");
    newscript.src = `https://javascript.dumorando.com/${pkg.replace("/", ".")}.js`;
    document.body.appendChild(newscript);
});
dynamicsofscratch
Scratcher
1000+ posts

advanced hahas

dumorando wrote:

(#257)
stuupid nerds: avoid global namespace pollution!!!!
me:
let packages = await fetch("https://javascript.dumorando.com/packages.json").then(data => data.json())
packages.map(pkg => {
    let newscript = document.createElement("script");
    newscript.src = `https://javascript.dumorando.com/${pkg.replace("/", ".")}.js`;
    document.body.appendChild(newscript);
});
*the nerds becoming more nerdier*
mybearworld
Scratcher
1000+ posts

advanced hahas

dumorando wrote:

(#257)
stuupid nerds: avoid global namespace pollution!!!!
me:
let packages = await fetch("https://javascript.dumorando.com/packages.json").then(data => data.json())
packages.map(pkg => {
    let newscript = document.createElement("script");
    newscript.src = `https://javascript.dumorando.com/${pkg.replace("/", ".")}.js`;
    document.body.appendChild(newscript);
});
I'm honestly surprised you can dynamically add script tags like that
dynamicsofscratch
Scratcher
1000+ posts

advanced hahas

mybearworld wrote:

(#259)

dumorando wrote:

(#257)
stuupid nerds: avoid global namespace pollution!!!!
me:
let packages = await fetch("https://javascript.dumorando.com/packages.json").then(data => data.json())
packages.map(pkg => {
    let newscript = document.createElement("script");
    newscript.src = `https://javascript.dumorando.com/${pkg.replace("/", ".")}.js`;
    document.body.appendChild(newscript);
});
I'm honestly surprised you can dynamically add script tags like that
Chiroyce
Scratcher
1000+ posts

advanced hahas

dumorando wrote:

stuupid nerds: avoid global namespace pollution!!!!
me:
let packages = await fetch("https://javascript.dumorando.com/packages.json").then(data => data.json())
packages.map(pkg => {
    let newscript = document.createElement("script");
    newscript.src = `https://javascript.dumorando.com/${pkg.replace("/", ".")}.js`;
    document.body.appendChild(newscript);
});
i tried that - took 14s for all the scripts to load and ended up with 1400+ errors in the console lol

Powered by DjangoBB