Jump to content

Style Problem


[dx]
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...