javascript - jQuery load with variable instead of element id -



javascript - jQuery load with variable instead of element id -

i've got slight jquery problem. want load particular area of external html doc div, instead loads whole document, not specified area.

this trigger:

$('a').click(function(){ // link trigger load var pid = $(this).attr('href'); //the pid links href getproject(pid); //trigger load function, pass variable });

this triggered function:

function getproject(pid) { $('#container').load('data.html', pid); }

so when click link, should load element id (#) specified link container, loads whole data... cant seem find solution this.

the link looks (cant utilize exact markup here): href="#elementtoload"

the info document looks this: div id="elementtoload" div id="..."

and loads of more elements content, should loaded id links href.

looking @ documentation $ load, should able this:

function getproject(pid) { $('#container').load('data.html #' + pid); }

javascript jquery ajax external

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -