Created
September 8, 2013 03:34
-
-
Save troyscott/6481623 to your computer and use it in GitHub Desktop.
jsonp request to php service.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>JSONP Example</title> | |
| </head> | |
| <body> | |
| <script src="//code.jquery.com/jquery.js"></script> | |
| <script> | |
| $( document ).ready(function() { | |
| console.log( "ready!" ); | |
| server = "http://localhost:8085"; | |
| service = "/service.php?callback=?"; | |
| request = server + service; | |
| console.log(request); | |
| $.getJSON( | |
| request, | |
| 'name=Troy', | |
| function(res){ | |
| alert('Your name is '+res.name); | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment