Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery load multiple html files in one element

How do i load multiple html files and putting them into a specified html element?

I tried with no changes:

$('#asd').load('file.html,pippo.html');
like image 771
itsme Avatar asked May 15 '12 17:05

itsme


1 Answers

you could get multiple items and add them to the element.

jQuery.ajaxSetup({ async: false }); //if order matters
$.get("file.htm", '', function (data) { $("#result").append(data); });
$.get("pippo.htm", '', function (data) { $("#result").append(data); });
jQuery.ajaxSetup({ async: true });  //if order matters
like image 82
earth_tom Avatar answered Oct 09 '22 21:10

earth_tom