0

I wonder is there a way to call my jquery function from my html code.

here's my code :

html side :

<td style="text-align:left;" align="left" >
    <div id="bulletin-timestamp" >
        doTimeStamp(${bulletinTimeStamp[status.index]})
    </div>
</td>

jquery side :

function doTimeStamp(x) {
    // do some parsing work
        return result;
}

I've tried

<script type="text/javascript">doTimeStamp(${bulletinTimeStamp[status.index]})</script>

but no effect..

Thanks!!

karaxuna
  • 26,752
  • 13
  • 82
  • 117
Mozzan
  • 283
  • 1
  • 2
  • 13

1 Answers1

2

You can't just return result. You need to add something to the DOM. In your script:

$('#bulletin-timestamp').text(doTimeStamp(x));
webduvet
  • 4,220
  • 2
  • 28
  • 39