title: Got url to fetch json data with username and password, how to secure it as javascript source shows username and password
body: <p>(I am using json with PHP)</p>
  
  <p>Hi i have got a url, from some web service saying:</p>
  
  <p><a href="http://www.example.com?username=" rel="nofollow">http://www.example.com?username=</a>$username&amp;password=$password&amp;fname=firstname</p>
  
  <p>Now they said they i can get data with xml or json to retrieve data along with passing my username and password. And when i googled found json is better option. Now i hv done doing json and received the required data  successfully.</p>
  
  <p>But i can see all the javascript i hav used to fetch in view-source of page. And so is the username with password.</p>
  
  <p>I am a new programmer when it comes to use json or say fetching data with REST.</p>
  
  <p>Can anyone just let me know the basic idea, that will be enough for me.</p>