0

I need to send some data ( say name, place, birth of year ) to a different machine ( say IP:70.80.203.55 port:5555) through javascript. I am new to javascript. Can u please tell me how can I do it ?

prashantas
  • 445
  • 1
  • 7
  • 19

2 Answers2

2

You can use jsonP for sending cross site data from javaScript. For more details on jsonP you can refer following links

http://learn.jquery.com/ajax/working-with-jsonp/

http://en.wikipedia.org/wiki/JSONP

What is JSONP all about?

Community
  • 1
  • 1
Sandeeproop
  • 1,756
  • 1
  • 12
  • 18
0

so, there are a few ways of doing that. i would recommend CORS: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing

using apache webserver on the external machine ( say IP:70.80.203.55 port:5555) you need to edit a .htaccess-file to allow external sources to send requests to the machine following the rules you've defined. the ajax request on your machine just hast to follow these rules as well, so it succeeds. should also be crossbrowser compatible: caniuse.com/#search=CORS

For Detailed Information on UsingCors with JavaScript: http://remysharp.com/2011/04/21/getting-cors-working/

Gooze
  • 73
  • 1
  • 10