0

I have two websites http://example1.com/ and another say http://example2.com/

A Javascript event click on example1.com/ will open a popup of example2.com/ , doing some operations i want to pass some data back to example1.com say with GET and detect it using jQuery or Javascript, not with PHP.

If data is authenticated it will invoke a event in example1.com.

I have tried using $.getJSON , curl from example2.com. but i either can't catch the data through my JS library or getting a CORS Error.

Example of such a behavior would be Facebook comment box, where after authentication Comment Box displays image and name of the person logged in.

Nikesh
  • 421
  • 3
  • 8

1 Answers1

0

For doing this you have 2 approaches

  1. Use jsonp :- What is JSONP all about?

  2. If you are using modern browsers(IE > 8) then you can also use postMessage API https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage I have written small blog on this topic you can check this also.

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