load external html file to div using jquery

戏子无情 提交于 2019-11-29 14:03:05

问题


I am using a html page which has many tooltips. each tooltip has a gallery, since it is not possible to use multiple gallery which has same id, I am planning to create 6 different html files for gallery, then load the gallery into my default page.

I need to cal the html page for each div. I tried .load but it is not working.

<div id="flrmain">need to call the html file inside this div.<div>

Please help.


回答1:


$.get('test.html')
 .success(function(data) {
     $('div.content').html(data);
 });

EDIT

If you need it for that specific div, replace 'div.content' with '#flrmain'.



来源:https://stackoverflow.com/questions/8849668/load-external-html-file-to-div-using-jquery

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!