i have a jQuery code to load contents from link in a modal window. this is my jquery code:
$(document).ready(function() {
var $loading = $('<img src="loading.gif" alt="loading">');
$('#page-help').each(function() {
var $dialog = $('<div></div>')
.append($loading.clone());
var $link = $(this).one('click', function() {
$dialog
.load($link.attr('href'))
.dialog({
title: $link.attr('title'),
width: 500,
height: 300
});
$link.click(function() {
$dialog.dialog('open');
return false;
});
return false;
});
});
});
HTML Code:
<a id="page-help" href="index2.html">Test</a>
i want to load contents in a DIV, not in a modal window!
How i can do this? 🙁
You can use the $.load method in jquery:
First you must have a div where you want to load the content to:
Then in your script: