|
From: David In NH on 15 Apr 2008 08:03 Hi all: Please excuse a newbie question but I could use some assistance. I have a large number of "help pages" for an application which we provide. Within those pages are sections of code that I want to conditionally comment out. These sections include HTML and Javascript elements. A sample: <p>For more information <script language="javascript">advancedHelp(" <strong>Click Here</strong>","13.htm");</script> to launch the help page. I've tried to define functions optionalHelpStart and optionalHelpEnd which would either be defined as empty (if we want the code above to be executed) or as follows if we wanted to hide it: function optionalHelpStart() { document.write ("<!--"); } function optionalHelpEnd() { document.write<"-->"); } and then recoding as follows: <script language="javascript">optionalHelpStart();</script> <p>For more information <script language="javascript">advancedHelp(" <strong>Click Here</strong>","13.htm");</script> to launch the help page. <script language="javascript">optionalHelpEnd();</script> but this doesn't work (even if I put it all on a single line). Is there a simple way that I can get this to work? The major problem is that we've got two products, one which supports the "advancedHelp" files and one that does not and we don't want to maintain two sets of files (there are something like 20 of them in each of 9 languages so far). Thanks in advance. - Dave
From: Tom de Neef on 15 Apr 2008 09:17 "David In NH" <dgintz(a)gmail.com> <snip> > <p>For more information <script language="javascript">advancedHelp(" > <strong>Click Here</strong>","13.htm");</script> to launch the help page. > Can't you give <p> a class and hide the lot via CSS in the product where you do not want to show this advanced help? It would remove all occurrences via one simple parameter. Tom
From: David In NH on 15 Apr 2008 09:30 "Tom de Neef" <tdeneef(a)qolor.nl> wrote in message news:4804ab04$0$14346$e4fe514c(a)news.xs4all.nl... > "David In NH" <dgintz(a)gmail.com> > <snip> > >> <p>For more information <script language="javascript">advancedHelp(" >> <strong>Click Here</strong>","13.htm");</script> to launch the help page. >> > > Can't you give <p> a class and hide the lot via CSS in the product where > you do not want to show this advanced help? It would remove all > occurrences via one simple parameter. > Tom > > Sorry Tom but I really am a newbie to this. I've inherited this work from the original programmer and am not familiar with CSS. I'll look into it though. Thanks for your suggestion. - David
From: pr on 15 Apr 2008 10:17 David In NH wrote: > I have a large number of "help pages" for an application which we provide. > Within those pages are sections of code that I want to conditionally comment > out. [...] Sounds like you're trying to use JavaScript to counteract an authoring problem. You might get something to work - at least on users' PCs that have JavaScript available and enabled - but ISTM that you should be looking instead at: a. some kind of authoring system: content management software or a custom solution (eg XHTML + XSLT). b. server code (eg PHP, ASP) to disable the unwanted bits of web pages, probably triggered by the query string (eg 'myhelp.html?product=standard|deluxe') and/or a cookie. (b) is the quicker. (a) is the more sensible. JavaScript doesn't have a lot going for it in this case.
From: Tom de Neef on 15 Apr 2008 12:17 "David In NH" <dgintz(a)gmail.com> schreef in bericht news:8sadnbY1_LJnMJnVnZ2dnUVZ_qiinZ2d(a)comcast.com... > > "Tom de Neef" <tdeneef(a)qolor.nl> wrote in message > news:4804ab04$0$14346$e4fe514c(a)news.xs4all.nl... >> "David In NH" <dgintz(a)gmail.com> >> <snip> >> >>> <p>For more information <script language="javascript">advancedHelp(" >>> <strong>Click Here</strong>","13.htm");</script> to launch the help >>> page. >>> >> >> Can't you give <p> a class and hide the lot via CSS in the product where >> you do not want to show this advanced help? It would remove all >> occurrences via one simple parameter. >> Tom >> >> > > Sorry Tom but I really am a newbie to this. I've inherited this work from > the original programmer and am not familiar with CSS. I'll look into it > though. Thanks for your suggestion. > > - David <style> p.advanced {visible=no} // or {visible=yes} I am guessing here; check the styles applicable to <p> </style> <p class=advanced> all text here will not show unless you change the stylesheet</p> Tom
|
Next
|
Last
Pages: 1 2 Prev: displaying a page from an iframe Next: displaying a page from an iframe |