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.
Asked
Active
Viewed 1.4k times
2

Ry-
- 218,210
- 55
- 464
- 476

vinanghinguyen
- 1,233
- 4
- 11
- 17
-
What is the context? What content are you trying to retrieve? – Jivings Dec 01 '11 at 01:35
-
Duplicate of http://stackoverflow.com/questions/8335198/how-to-load-url-into-div-tag – Gregg B Dec 01 '11 at 01:36
-
Have your PHP get the content, and send it on to the client. – RightSaidFred Dec 01 '11 at 01:37
2 Answers
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.

Greg Kramida
- 4,064
- 5
- 30
- 46
-
2While 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