Confused on JS error
Hey so, can anyone explain to me how "text" or "dataWrapper" are not of type Node?
One literally gets seen as HTMLDivElement when hovering over and the other gets seen as HTMLParagraphElement
In the console you see me first checking if it correctly gives the date when I ask for it
Second in the console is what's within my span (which is a part that'll get added to text, so text consists of
<p><span></span></p>
)
Thirdly you see what's within text
3 Replies
I am creating the HTML file via JS as I want it all to be on the same page, but change depending on which tab you click open
I know there is a way to load a page within your page, but I have no clue how
I assume it would be something with an
<iframe>
, if anyone can give me a quick explanation on how to load a page within your page I could just change over to that
The reason for this is, actually... Now that I'm in this position, I don't need to keep them on one page --- wait nvm there is, this is a demo, so it doesn't work with a database, so data given in has to persist and if I load a new page this data would be lost
So if I can get the index.html loaded at all time and have the other pages load inside of index.html then it should be fine as I can keep the data persisting in index.html I think?
OH and another question, why on earth does it say its the 7th month even tho its the 8th?
is this simply a bug on my end or does date.getMonth()
work 0-based and I just have to do an +1 to fix it ?Here is some more code related to this issue
If you wish for me to put it on a codepen, let me know and I'll do so
but maybe you guys are able to see what the cause is without having the code
OKay, issue is resolved, I am simply stupid
= text
instead of = text.innerHTML
and the getMonth issue is resolved to, its 0-indexed
Who in their right mind thought of doing that '-'