using ajax to update div in other page
i have a page named news.jsp , which lists all news titles a开发者_Go百科nd users can read the full body by clicking on the name of a particular news. i am using ajax to load the news body into the same page in a span tag. i also show my top 5 news in index.jsp.
if a user clicks on a news in index.jsp , i want to redirect him to my news.jsp and load the selected news for him/her, again with ajax.
but when i redirect to news.jsp with javascript , this doesnt work. is there a way to update my which is in news.jsp , from index.jsp and then redirect to?
and my apologize for my poor english. thnx
I think from what you describe you want to pass some news id in the querystring then in the news page onload event check if querystring present then if so fire ajax event
You could store your news as a session is jsp or javascript/cookie and populate the content upon page load. Would this do what you're looking for?
精彩评论