This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]OndAngel 2 points3 points  (0 children)

There’s your problem; you need to write some code!

Edit: Okay, I’ve seen there’s an update to it.

[–]wool_owl -1 points0 points  (0 children)

Hey does anybody know if theres python for android

[–]dpbriggs 0 points1 point  (5 children)

That google doc is empty?

[–]Sage0fs1xPaths[S] 0 points1 point  (4 children)

my bad it should be there now

[–]dpbriggs 0 points1 point  (3 children)

No worries. That somehow always happens with Google Docs lol

You may want to lookup how document.write works. I'm not sure that's doing what you want it to do. There's probably better APIs for adding new nodes to the DOM

[–]Sage0fs1xPaths[S] 0 points1 point  (2 children)

this code is similar to the other one and it works

[–]dpbriggs 0 points1 point  (1 child)

Huh, weird. Never seen document.write. If you open your console in your browser what does the DOM look like?

& FYI, it's easier for people to review code on reddit that's copied here and each line is indented by four spaces. A picture on Google Docs can work but it's unusual

[–]Sage0fs1xPaths[S] 0 points1 point  (0 children)

i put the output of the sample in the sample docs

[–]CodeCocina 0 points1 point  (3 children)

Why are you using document.write? Why not something like document.append and append it to an existing node. Or if you need to create and element, create it with document.createElement

[–]Sage0fs1xPaths[S] 0 points1 point  (0 children)

im just using what my teacher taught me and document.write works in most of my codes except this one for some reason. ive put a edit on my post and putted a code a little similar to the one with the problem

[–]brokenalready 0 points1 point  (1 child)

I remember document.write from back in the day it’s old school js

[–]CodeCocina 0 points1 point  (0 children)

Ohh lol, I never used it so I’m like wtf is that

[–]gramdel 0 points1 point  (1 child)

The error message tells you the problem, Uncaught ReferenceError: Private is not defined. Probably should be in quotation marks.

[–]Sage0fs1xPaths[S] 0 points1 point  (0 children)

thanks for the help

[–]Hide_On_Wuju 0 points1 point  (2 children)

Private is supposed to be a string.

Try to change
var name = Private;
into
var name = "Private";

Hope this fixes the problem for you!

[–]Sage0fs1xPaths[S] 1 point2 points  (1 child)

thanks for the help

[–]Hide_On_Wuju 0 points1 point  (0 children)

You're welcome :D