title: Facebook and JavaScript - getting user's name
body: <p>I'm kind of going crazy already - I'm trying to do a very simple facebook app that would just write my name. I had problems with php (my server doesn't support php5 and curl) so now I'm trying it in JavaScript. You can see the code I used here - <a href="http://developers.facebook.com/docs/authentication/" rel="nofollow">http://developers.facebook.com/docs/authentication/</a> under the sentence "The following HTML/JavasScript example demonstrates the client-side flow in one self-contained example:".</p>
  
  <p>I have a problem - it does write my name, but:
  1. only in one of my browsers - I have chrome and opera open, javascript allowed in both, in both logged on facebook, but my name displays only in chrome</p>
  
  <ol>
  <li>when I add under userName.innerText = user.name; alert(user.name);, I get in both browsers alert message "undefined"</li>
  </ol>
  
  <p>You can see it here: <a href="http://apps.facebook.com/krajecr/funguj.html" rel="nofollow">http://apps.facebook.com/krajecr/funguj.html</a></p>
  
  <p>Do you know what's wrong? Thanks in advance...</p>
  
  <hr>
  
  <p>Ok, I solved the alert thing - just made a new variable, which stored user.name and used that in the alert. Still no idea why it didn't work though and I still don't know what to do with opera</p>