I'm not sure what your HTML looks like, but
$("twitter").attr("id", url);
should be:
$(".twitter").attr("id", url);
Update: try this code ... you need to determine if iframe ( demo ) is loaded
$(function () {
In addition, since we are changing the identifier of the tweeter, we need to save this jQuery object.
source share