0
IP Adresses 2
Okay so for this one im trying to actually show the user their IP. Heres the url to the website as a reference https://www.ipify.org/ its not giving me any kind of error i see so what is the problem here? https://code.sololearn.com/WSAhNMGKsXOK
15 ответов
+ 1
Your code does return an error. Get IP not defined.
0
so how do i exactly make it defined? also r yall doing ctrl + shift + i? or r u using sololearn console?
0
first i had to make my console.log to document.write()
0
secondly i had to put my first script src
0
below my script containg my function and console
0
So 2 questions. why and why?? why do i have to do that and doesnt work how it was before
0
Maybe this can help about why the script belongs at the bottom.
https://levelup.gitconnected.com/all-about-script-87fea475b976
0
I didnt see anything about putting a script at the bottom of the page. did u? Also why did i have to change the console.log to document.write?
0
Yes i did see something about placements.
"When you place your JavaScript at the bottom of your HTML body, it gives the HTML time to load before any of the JavaScript loads, which can prevent errors, and speed up website response time." It is not clear but I suppose that means your api loaded before your script. So it was out of scope.
Also now that you have your tags in the correct order, you can use console.log
0
Hmm..ok. But my console.log does not work unless it only works on computer or smth .
0
Chris Coder Is the console.log working for u?
0
Yes console shows up right after I run the code. But if I swipe down to hide it I can not make it come back up.
0
Keep trying to swipe up from the bottom it finally worked for me
0
okay