Why are you even bothering with an onclick attribute? for (var i = 0; i < totalPages; i++) if (i != currPage - 1) $('<a href="javascript:void(0)">') .click((function(i) { return function(e) { showPage(i + 1); }; }(i)) .text(i + 1) .appendTo('#resultspaging'); else $('<span class=page>').text(i + 1).appendTo('#resultspaging');
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] androcles wrote: > Hi. I'm having some issues on jquery, specifically with safari. I > need to create dynamic links for paging, so I use this code inside a > for statement > > for (var i = 0; i < totalPages; i++) > if (i != currPage - 1) > $('<a></a>').attr('href', 'javascript:void(0)') > .attr('onclick', 'showPage(' + (i + 1) + ')') > .html(i + 1) > .appendTo('#resultspaging'); > else > $('<span></span>').addClass('page').html(i + 1).appendTo > ('#resultspaging'); > > This shows ok on Firefox. In safari, the "onclick" attributes are not > rendered, so my links are totally inactive. It works if I set the JS > function to the 'href' attribute, but there is another place where I > neet to set a 'onclick' attribute to a 'tr' element, that doesn't has > 'href' attribute. > > http://portal.anacafe.org/CoffeeSearchSystem/ > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---