tags:

views:

30

answers:

1

How to get html code [ complete div code ] from cross domain. I heard that we can get by using jquery, Ajax, Json concepts. I tried to research on these. But i dint understand how to access. Please give any simple example. I need to know atleast small information.

Thanks in advance

+2  A: 

I would suggest writing a server side page, service, handler, etc... that does the cross domain request to grab the html and serves it up. Then you can use jquery to do an ajax call to fetch the results of your server side handler (which would be located in your domain).

You didn't specify what server side technology your using (if any) so I am not sure if this is an option and I am assuming your doing some type of screen scraping?

Here is a PHP sample and an ASP.NET sample implementation.

Kelsey
Thanks for responding.Server side technology : Jsp, serveltspresently i am using json concepts to get cross domain calls. is there any alternative except XML concept.And if we keep it all JSP files in server side, product performance will reduce right? so is there any other alternative?
poineer
@poineer you are going to need a proxy to access the html cross domain so you will need to keep it server side and yes performance will be affected because your server will need to proxy the information you are gathering because the client doesn't have access to do it. If this answer helped you don't forget to upvote it or set it as the accepted answer.
Kelsey