2

I know get content in PHP with file_get_contents('url') but I don't know how to get content with jQuery. please guide me how to load content of URL: http://vnexpress.net.

Ry-
  • 218,210
  • 55
  • 464
  • 476
vinanghinguyen
  • 1,233
  • 4
  • 11
  • 17

2 Answers2

4

You can use either the $.get() or $.load() functions, depending on how you want to use the HTTP content. $.get() will let you manipulate the content, $.load() will let you place it into an element on your page.

Reference for load

Reference for get

Greg Kramida
  • 4,064
  • 5
  • 30
  • 46
  • 2
    While this would indeed get the content from a given url, it won't work because of the Same Origin Policy. –  Dec 01 '11 at 01:46
0

Is this what you are looking for? http://api.jquery.com/load/

xbrady
  • 1,683
  • 14
  • 23