Rishabh
Rishabh

Reputation: 3852

How to read an external html page using jquery?

I am using .ajax function to read data from an external page . I am not able to read the page and I get the exception as Access Control Allow origin. i want to show the data of another page in my page I even set crossdomain:true but it dint help

  $.ajax({
type: "GET",   url: myurl,
dataType: "html",
 crossDomain:true,
success:parsehtml});

How to read an external html page using jquery ?

Upvotes: 0

Views: 1081

Answers (2)

Tariqulazam
Tariqulazam

Reputation: 4585

There is one solution without using any server side technologies. Please see this http://net.tutsplus.com/tutorials/javascript-ajax/quick-tip-cross-domain-ajax-request-with-yql-and-jquery/

You may have to process the returned output to suit your need.

Upvotes: 1

UnkwnTech
UnkwnTech

Reputation: 90841

The underlying Javascript engines in most modern browsers don't permit Cross-Domain transactions. You will have to use a server-side language such as PHP to do this. Mozilla has a fairly decent description of this issue.

Upvotes: 2

Related Questions