jquery - Keeps prepending several images -


I am working on SharePoint with jQuery and every time I use the prepaid () function with each () function. To display an image in front of each cell in the list I use in combination, I get many of those pictures.

More specifically, the quantity of those pictures corresponds to the amount of items in the list. I'm sure this is a clue what's happening, but I'm not a jQuery expert.

Here's a piece of code:

  $ .each (function (I, e) {$ (e) .prepend (image);});  

Image, BTW, Image is a variable that contains the HTML code for the image item is:

< Pre> var item = #MSO_ContentTable td.ms-vb2 & gt; Div: is (& gt; div);

This place is awesome!

You can do this:

  $ (item). Each (function (i, e) {$ (e) .prepend (image [i]);});  

But it is not clear if there is a image , if it is a set of elements, then it searches every match item selector If it's a jQuery element or an array, then it will work, if it's something else, then post it.

The above example matches the matching image and adds it in the same current item matching of the same index, it is best, as asked I had gathered from that question.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -