Not able to use javascript in Dataset

Hi ,
I am trying to create a data set of 2 columns with String Data type. I am trying to add a custom javascript so that rows loop continuously in the display. ie, First row should re-appear after the last row in the table and it should continue.

Here is the my javascript

function moveRows(){
firstTR = $(‘tbody tr’).first();

function EmbedInit() {

However the above script seems to make any difference … The same script works if I use an embed html widget (of course with a custom html sample data)

Any help / pointers please ? many thanks…