Create “Login With”-Button JSONP?

domsivoral

New Member
i want to create an "Login With MySite"-Button similar to the all known Facebook Login Button. In my case it should be much simplier (what doesn't mean, that I know how).A website, which will include my "Login Button" provides a form, like:\[code\]<form action="save.html" id="FormName"> <div>Lastname: <input type="text" id="lastname"/> </div> <div>Firstname: <input type="text" id="firstname"/> </div></form>\[/code\]By pressing the "Login Button" people get the fields I can provide pre-filled out.I created a version, where you get the data by GET, but this ain't pretty:\[code\]<html><head> <title> SomeHtml Form </title> <script type="text/javascript"> function fillForm(){ var form = document.forms['FormName']; form.elements['lastname'].value = "http://stackoverflow.com/questions/11468283/<?php if (isset($_GET['lname'])) echo $_GET['lname']; else echo "";?>"; form.elements['firstname'].value = "http://stackoverflow.com/questions/11468283/<?php if (isset($_GET['fname'])) echo $_GET['fname']; else echo "";?>"; } function getParameters(){ self.location.href="http://localhost:8080/test/services/export/getuser.mvc"; } </script></head><body onLoad="fillForm()"> <h1>Some Form</h1> <form action="save.html" id="FormName"> <div>Lastname: <input type="text" id="lastname"/> </div> <div>Firstname: <input type="text" id="firstname"/> </div> </form> <button onclick="getParameters();">Fill Form</button></body></html>\[/code\]I heard about JSONP where I could do this way more elegant, but I don't know how?!! :(My Service (providing the information the loginbutton should give) is based on SPRING and Java Servlets. The site receiving the information might be anything, they should only have to implement the button and maybe change the IDs of the input-fields.
 
Top