Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get PHP file using Javascript/JQuery

I need to use javascript or jquery to get a html or php file and put its contents inside a div of the current page.

I know how to do this using ajax but would like to know if there is a simpler way without having to use all the code that ajax uses.

like image 497
Chris Avatar asked Sep 26 '26 18:09

Chris


1 Answers

I think you are looking for jQuery's $.load.

$('#div_id').load('url');
like image 91
mellamokb Avatar answered Sep 29 '26 09:09

mellamokb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!