0

I have a div displayed in the manner you see on the code and I need it to be refreshed everytime someone click on one of the links:

$str.= "<div id='foldersdiv'>";

  foreach ($folderslist as &$value) {
  $str.= " <a href=\"#1\" onClick=\"change_status_sp('{$spDetails->sp_id}','".$valu."');\">".$value['items']."</a>";

}
}    // loop ends

  $str.= "</div>";
5
  • why is this question voted down? Commented Mar 11, 2012 at 3:34
  • I thought I was doing something wrong but good luck with that. Great attitude :) Commented Mar 11, 2012 at 3:36
  • Refreshed from where? Also, don't use onClick, use proper event binding Commented Mar 11, 2012 at 3:37
  • refreshed from the same file list.php Commented Mar 11, 2012 at 3:37
  • @Phil I can bind it correctly once it works ...im trying to get it to load first Commented Mar 11, 2012 at 3:48

1 Answer 1

1

Very basic example. This will get you started. But I'd look into the .ajax function. It has heaps of options.

function change_status_sp(id)
{
    $('#foldersdiv').load('ajax/list.php?id='+id, function() {
        alert('Load was performed.');
    });
}

jQuery Load

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.