Jump to content

Style Problem


[dx]

Recommended Posts

Hi, I'm using AJAX to retreive new posts every 2 seconds based on last time I've accessed it.So it backs me right data. Everything perfect. I'm using textarea and table in it, so data will be retreived like this:

<tr><td>Message 1</td></tr> <tr><td>Message 2</td></tr>
So every request will return new message and will be prepended to this old result (something like Facebook status in right top corner). So, if I don't have new posts, there is message "There's no new posts". In next request, if I get new post, that message will disapear, and new data will show. Trick is, that I hide message "There's no new posts" with javascript trough AJAX.So result is:
<script>hide function here</script><tr><td>Message 1</td></tr><tr><td>Message 2</td></tr>
Every of <td>'s in result has style <td style="padding... etc"> Always it's shown fine, except only when I call javascript function. Javascript function is not called everytime. Only when there's no messages and next request returns first message in box. Hope you can understand what's my problem. Problem is that I got result, but unstyled. In firebug, I god <td>'s with style, but in view page, it's messed. When I comment <script> call line, styles are ok, except my messages prepend to message, which looks stupid like:
Message 2 Message 1There's no new posts
Regards.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...