I generate html like this in javascript as you can see theres an a tag in html
when I click first time in link it hit the action, but sometimes (can say 90% of cases) second click doesnt hit the action unless I clear the firefox or chrome cache what's going here? and how can I solve this problem?
$.each(response, function (index, item) {
htmlcontent = "<div class=''>" +
"<a target='_blank' href='/Stat/" + item.Code + "/" + item.RId + "'>" +
"<img class='' src='/Images/" + item.ImageId + "'/>" +
"</a>" +
"</div>";
$('.div_SecondCol').eq(index).html(htmlcontent);
});
and this is action
// GET: Stat/{code}/{RId}
public ActionResult AdsStat(string Code, int? RId)
{
try
{
#region Load Data
//some code
#endregion
#region Insert Data
//some code
#endregion
return RedirectPermanent(externalUrl);
}
catch (Exception e)
{
}
}
when I add a random number at the end of href it works! but I need to know what's going here?
var randnum = Math.floor((Math.random() * 1000) + 1);
"<a target='_blank' href='/Stat/" + item.Code + "/" + item.RId + "?rnum=" + randnum + "'>" +