i've got a slight jQuery problem. What i want is to load a particular area of an external html doc into a div, instead it loads the whole document, not the specified area.
This is the trigger:
$('a').click(function(){ // my link to trigger the load
var pid = $(this).attr('href'); //the pid is the links href
getproject(pid); //trigger the load function, pass variable
});
This is the triggered function:
function getproject(pid) {
$('#container').load('data.html', pid);
}
So when i click my link, it should load the element with the id (#) specified by the link into my container, but it loads the whole data... i cant seem to find a solution to this.
The Link looks like this (cant use exact markup here): a href="#elementtoload"
The data document looks like this: div id="elementtoload" div id="..."
and loads of more elements with content, which should be loaded by id from the links href.