So I have the following JavaScript which pulls user data from Facebook:
As you can see in that snippet I have included the line 'console.log(full_name);', which when ran successfully outputs the users full name into the browser console.
Then when I try this:
<script>document.write('Hello, ' + full_name);</script>
It doesn't work. It comes back with Uncaught ReferenceError: full_name is not defined
.
I am confused as it is clearly defined & works when using console.log
. Someone help?