I'm trying to use jQuery's .load function to load new content into a div of unknown ID. I'm trying to grab its ID from a child element. Starting with an alert returns the parent ID:
<script language="javascript">
$('#submitbtn').click(function(){
var parentId = $('#windowanchor').parent().attr('id');
alert('ID = ' + parentId);
});
</script>
Good. However, when modifying the code to include the .load function no content is loaded:
<script language="javascript">
$('#submitbtn').click(function(){
var parentId = $('#windowanchor').parent().attr('id');
$(parentId).load("plug.php?r=calendar&m=edit&id=1");
});
</script>
I suspect that the syntax I've used is wrong (js/jquery rookie). Please help!