私はプロットする要素のid
属性が必要であるというこの愚かな要求を持っているjqPlotを使用しています。存在しない要素のIDを取得しますか?
しかし、私のjavascriptは要素で動作するjQueryを使用しており、IDを持つdivに依存したくありません。
何らかの理由で、jQuery $(this)
要素を指定すると、divのためにオンザフライでid
を生成し、そのIDをjqPlot関数に渡すことはできますか?このような
何か:感謝
(function($){ //jquery plugin style
$.fn.myPlot = function(){
//Somehow get id for "this"
var generatedId = somehowCreateID(this);
jqPlot.plot(generatedId);
}
})(jQuery);
任意のヒント!