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.
asked Jan 13, 2012 at 11:11
Sowmya
27k21 gold badges102 silver badges137 bronze badges
-
2What means 'not working'? Nothing happens? You get errors? Not all content gets loaded? etc. Please post the code you tried.BartekR– BartekR2012年01月13日 11:15:31 +00:00Commented Jan 13, 2012 at 11:15
-
No it's not working!! I have added only div portion in external html (without doctype/body/html tags).. tried with below code but not getting html page inside my div. $.get('timeless_op1.html') .success(function(data) { $('#flrmain').html(data); });Sowmya– Sowmya2012年01月16日 06:35:35 +00:00Commented Jan 16, 2012 at 6:35
1 Answer 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'.
Sign up to request clarification or add additional context in comments.
2 Comments
Skyrim
Replace
test.html with your url (you can also specify query parameters, just check out the documentation at jquery).commonpike
default