I’m trying to write a function in javascript that receive two arguments (target, content) to load content with ajax using $.load() jquery function, the code is above:
function cargarContenido(content,target) {
$(target).load(content);
}
I call the function like that and it doesn’t work:
<a href="#" onclick="cargarContenido('hd.html','content')">
Thanks!
Your target is an invalid selector. You need something like
#content