Using found address to load
Sorry for this basic question.
I need to retrieve part of a web page pointed to by a link <a class="fetch" href='web_page_address'> ... The part I want has an id of 'unit_descr'.
When I know the address beforehand and can enter it manually without fetching it, this works:
$(document).ready(function() {
$('.insert_point').load('web_page_address #unit_descr');
return false;
});
However when I try to fetch the address and concatenate with the id of the part I want, it will not work
$(document).ready(function() {
var url=$('a.fetch');
$('.insert_point').load(url + ' #unit_descr');
return false;
});
I suspect that $('a.fetch') selects a complete JQuery object whereas I only want the content. .
Given that I can get hold of the content and put it into the url-variable,I am also not sure whether it is OK to use url +' #unit_descr' to construct the argument for the load function.