JQuery:insertBefore整个对象
下面是选择特定对象并在sharepoint 2010中员工目录项列表中的所有对象之前插入的代码。
如果职位名称在managerTitles
列表中,如果他们不是第一个,请将此人列为列表中的第一个人
if($.inArray(jobTitle3, managerTitles) >= 0) { // If they're not first in the list, move them there" if(personIndex > 0) { // Move the manager to first $(this).insertBefore($('.psrch-FullResult:first')); } // Insert a block div to create a line break after the manager $("").insertAfter($('.psrch-FullResult:first')); //removed this line due to need for multiple heads of a dept -- return false;//Leave the .each iterator }
代码
$(this).insertBefore($('.psrch-FullResult:first'));
什么都不做,所以代码
$("").insertAfter($('.psrch-FullResult:first'));
但当我尝试写一些东西时
$("testing
").insertBefore($('.psrch-FullResult:first'));
有用
请提出一些解决方案。