Re: js code in the jsp page



On Fri, 2005-04-08 at 09:08 -0400, Colin Walters wrote:
> On Fri, 2005-04-08 at 14:48 +0200, Alexander Larsson wrote:
> > I see that someone has moved a bunch of code related to setting the
> > document title to the jsp page. Any special reason for this?
> > 
> > I think we should avoid putting much code in the page itself. Its much
> > cleaner to separate the html from the code as much as possible.
> 
> Sure, we can separate it.  The reason it was moved is because it is very
> specific to the topic.jsp page.  We want to be able to use the
> JavaScript Topic class also for the topiclist.jsp page; there, we don't
> want to have references to theTopic and have it changing window.title,
> etc.  We could rename topic.jsp to topicdisplay.jsp or something, and
> move the code in it to topicdisplay.js.

Eh? But the topic class is specific to the topic.jsp page in many more
ways. Like, it accesses ids such as "closedcomments" and creates dom
nodes that only make sense for that page. And functions such as
Topic.getInterestingObjects() make no sense if you're using the topic in
topiclist.jsp. 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an obese vegetarian farmboy whom everyone believes is mad. She's a plucky 
tomboy archaeologist who dreams of becoming Elvis. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]