Hey ho,
this is probably a simple question, but I did not find an answer so far.
Given I have:
$("a.clickable").livequery('click', (function (e) {
var values = $(this).attr('id').split('_');
$('#' + values[3]).load($(this).attr('href'));
e.preventDefault();
}));
You see, I want all links with the class "clickable" to cause an ajax load. The target div however varies, so I´ve simply put this - along with some other data - into the Id´s link: "link_value1_value2_targetDivId".
So I currently split the id to get an array of values to work with. I know about $(obj).data(), but I need to pass some stuff on serverside.
Is there a ways to achieve this without this ugly id-string-parsing? ASP.Net/MVC btw.
Thanks for any suggestion