jQuery( document ).ready(function( $ ) { var last = ''; $('#KBPluginContent').on('click', '.kb-nav', function(){ var ajax_uri = 'https://research.wisc.edu/wp-content/plugins/kbarticledisplay/kbcall.php'; var curr_uri = 'https://research.wisc.edu/buckysubmit/'; var api_url = $(this).attr("value"); $.ajax ({ url: ajax_uri, data: {"api_url": api_url, "curr_page": curr_uri, }, type: 'POST', success: function(result) { $('#KBPluginContent').html(result); last = api_url; } }); }); $('#KBPluginContent').delegate('.something_to_test a', 'click', function(){ var ajax_uri = 'https://research.wisc.edu/wp-content/plugins/kbarticledisplay/kbcall.php'; var curr_uri = 'https://research.wisc.edu/buckysubmit/'; var api_url = 'https://kb.wisc.edu/gsadminkb/api/v1/articles/' + $(this).attr("value"); $.ajax ({ url: ajax_uri, data: {"api_url": api_url, "curr_page": curr_uri, }, type: 'POST', success: function(result) { $('#KBPluginContent').html(result); $('#KBPluginContent').prepend('Back to Directory'); } }); }); });