I’m trying to make an AJAX oriented board and I want to handle each articles’ written time fields and update those time fields every 5 seconds.
I would like to show contents with changing written time every 5 seconds whether there is a new comment on an article when a user is reading it.
So the key point is that handling DOM objects in page but the hard part is that typically javascript is read before the whole page is read but I would like to innerHTML changing (dynamically) javascript and also want to handle DOM objects(also dynamically changed and inserted through innerHTML) with it
Is there any way that I can put a dynamically created Javascript which is from PHP and insert that to the HTML by AJAX (jQuery) ?
It would help a lot if you clarified your question. Structurally, javascript can be run at a number of different times in the life of a web page. Here are a few of those times:
So, in your case, it sounds like you would want to do something like the following: