"Logic Al" <ignoring@lycos.co.uk> writes:
[color=blue]
> books1999 <books1999@hotmail.com> wrote in message
> news:1116948362.576712.89890@f14g2000cwb.googlegro ups.com...[/color]
[color=blue]
> Stephen this link reports an invalid character error and it does not
> collapse the frame.
>
> <A HREF='#' onclick='if(document.body){var
> fc=parent.document.body.cols;
> parent.document.body.cols=(fc=*="230,*"[/color]
^
There is an extra "-" between the two ='s, that shouldn't be there,
i.e., "=-=" should be just "==".
[color=blue]
> ? "5,*" : "230,*");}'>Collapse/Restore</A>[/color]
[color=blue]
> Can you please tell me what is wrong with it?[/color]
It should be a button, not a link. Links are for linking to content,
buttons for doing things (but that's a usability problem, not a
programming error :).
There is no need to define a variable if the value is only used once.
Try just:
<button type="button" value="Collapse/Restore"
onclick="if(document.body){
parent.document.body.cols =
(parent.document.body.cols == '230,*') ? '5,*' : '230,*';
}">
[color=blue]
> I told you to put it all on one line, not wrapped as it may appear.[/color]
Attributes can contain newlines, so it doesn't need to be one line.
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'