I have a JavaScript file that writes an ID to a cookie value. I'd like to use Ajax to lookup and retrieve the title of the ID.
Here is what I have but don't know how to do the Ajax request. Any help would be appreciated. The Ajax call should replace ProductArray[x] below.
function loadCookieList () {
var CookieValString = $.cookie(CookieName);
var TheHTML = '<li class="nav-header">Saved Listings</li>';
if (CookieValString) {
var ProductArray = [login to view URL]('|');
[login to view URL]();
for (var x in ProductArray) {
$.ajax({
type:'GET',
url:'/js/[login to view URL]',
data:{ProductArray[x]},
success: function(data) {
alert('success');
}
);
TheHTML += '<li style="margin-bottom:6px;"><a style="display:inline;" href="[login to view URL]'+ProductArray[x]+'">'+ProductArray[x]+'</a> <span class="Delete" id="'+ProductArray[x]+'"><i class="icon-remove-sign"></i></span></li>';
}
$('.span3 .sidebar-nav').show();
} else {
$('.span3 .sidebar-nav').hide();
}