A
Alec S.
Hi,
I need a way of dividing up my site into "departments". What I want is
to be able to allow some JavaScript functions to perform differently based
on what department the current page is assigned to.
For example, if the user clicks on a link in a page, the link fires off
a JS function that checks what department the page is in and does something.
If the user clicks on that link on a different page assigned to a different
department, the function does something else.
What I tried to do was to put in an invisible DIV element in the pages
where the ID attribute of the DIV is "_dept_" and the NAME attribute is
whatever the department is. The JS function looks for the _dept_ element
and reads it's name attribute. The problem with this is that when I try to
validate the page I get an error on the name attribute (not in XHTML
Strict).
What can I do?
thanks.
I need a way of dividing up my site into "departments". What I want is
to be able to allow some JavaScript functions to perform differently based
on what department the current page is assigned to.
For example, if the user clicks on a link in a page, the link fires off
a JS function that checks what department the page is in and does something.
If the user clicks on that link on a different page assigned to a different
department, the function does something else.
What I tried to do was to put in an invisible DIV element in the pages
where the ID attribute of the DIV is "_dept_" and the NAME attribute is
whatever the department is. The JS function looks for the _dept_ element
and reads it's name attribute. The problem with this is that when I try to
validate the page I get an error on the name attribute (not in XHTML
Strict).
What can I do?
thanks.