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!!

4

1 回答 1

2

你不能只返回结果。您需要向 DOM 添加一些内容。在您的脚本中:

$('#bulletin-timestamp').text(doTimeStamp(x));
于 2013-10-24T08:35:13.073 回答