Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get Url source code via Javascript
11-01-2013, 05:21 PM
Post: #1
How to get Url source code via Javascript
Get Url source code via PHP function is
file_get_contents('http://');

i want to get url source code via javascript.

Please help me . Thanks.
Find all posts by this user
Like Post Quote this message in a reply
11-03-2013, 02:36 PM (This post was last modified: 11-03-2013 02:36 PM by ionutvmi.)
Post: #2
RE: How to get Url source code via Javascript
You can have the file_get_contents() in js also.
You can find more about it here http://phpjs.org/functions/file_get_contents/ this is a good option if you are not using any framework.

However if you use jquery you can do it like this:

Code:
$.get( "ajax/test.html", function( data ) {
  $( ".result" ).html( data );
  alert( "Load was performed." );
});
you can find the full documentation here http://api.jquery.com/jQuery.get/
Find all posts by this user
Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)