Help in putting the right coding in if JavaScript is turn off.

G

Guest

I am currently using Frontpage 2003. I have a JavaScript function that makes
certain information appear on a page when a hyperlink is clicked. Due to the
fact that users may turn off JavaScript, I am looking for advise that will
enable me to have an alternative.

the function I am using is:

<SCRIPT type=text/javascript>
function close_all() {
document.getElementById('relatedprocess').style.display = 'none';
document.getElementById('tailoringguide').style.display = 'none';
}
function show_div(div_id) {
close_all();
document.getElementById(div_id).style.display = 'block';
}
</SCRIPT>

and at the appropriate place for the hyperlink I put the following in:

<DIV id=tailoringguide style="DISPLAY: none">
<TABLE cellSpacing=0 cellPadding=5 width="100%" border=0 id="table29">
<TBODY>
<TR bgColor=#a50042>
<TD width="100%" bgcolor="#541586"><FONT face=arial color=white
size=2><B>? </B></FONT>
<b><font face="arial" size="2" color="#FFFFFF">Tailoring
Guide</font></b></TD>
<TD bgcolor="#541486"><A href="javascript:close_all();">
<IMG
src="x.gif" border=0 width="10" height="10"></A></TD></TR>
<TR>
<TD colSpan=2><font size="2">For smaller projects the PM will
normally perform many (or
all) of the other roles within the team,.........

I know I can create a separate page with the same information on, what I do
not know is what alternative coding I need and where to put it, so that when
a user click the same hyperlink, they still get the same information, if they
disable JavaScript.

Hope someone can help me?
 
S

Stefan B Rusynko

That is why you should never just have a JavaScript link as in
<A href="JavaScript:close_all();">
But you should have a std hyperlink w/ a JavaScript onclick event (which will fire if JS is not disabled)
<A href="thealternatepage.htm" target="_blank" onclick="close_all();">

--




|I am currently using Frontpage 2003. I have a JavaScript function that makes
| certain information appear on a page when a hyperlink is clicked. Due to the
| fact that users may turn off JavaScript, I am looking for advise that will
| enable me to have an alternative.
|
| the function I am using is:
|
| <SCRIPT type=text/javascript>
| function close_all() {
| document.getElementById('relatedprocess').style.display = 'none';
| document.getElementById('tailoringguide').style.display = 'none';
| }
| function show_div(div_id) {
| close_all();
| document.getElementById(div_id).style.display = 'block';
| }
| </SCRIPT>
|
| and at the appropriate place for the hyperlink I put the following in:
|
| <DIV id=tailoringguide style="DISPLAY: none">
| <TABLE cellSpacing=0 cellPadding=5 width="100%" border=0 id="table29">
| <TBODY>
| <TR bgColor=#a50042>
| <TD width="100%" bgcolor="#541586"><FONT face=arial color=white
| size=2><B>? </B></FONT>
| <b><font face="arial" size="2" color="#FFFFFF">Tailoring
| Guide</font></b></TD>
| <TD bgcolor="#541486"><A href="javascript:close_all();">
| <IMG
| src="x.gif" border=0 width="10" height="10"></A></TD></TR>
| <TR>
| <TD colSpan=2><font size="2">For smaller projects the PM will
| normally perform many (or
| all) of the other roles within the team,.........
|
| I know I can create a separate page with the same information on, what I do
| not know is what alternative coding I need and where to put it, so that when
| a user click the same hyperlink, they still get the same information, if they
| disable JavaScript.
|
| Hope someone can help me?
| --
| Sharon a users of Frontpage, but no coding experience
 
M

Murray

<A href="thealternatepage.htm" target="_blank" onclick="close_all();return
false">

Right? Otherwise, both would fire.
 
G

Guest

Using the code you or Stefan have suggested, works to a point. It does what
I want it to, but the one thing that has disappeared is that I had a X, which
when you clicked on it it closed the information. What seems to have
replaced that , when I look in Frontpage is that there is now a flag which
would take it to the alternative page if javascript was disabled.

What do I need to do to ensure the user can close the information once they
have finished with it.
 
G

Guest

Using the code you or Stefan have suggested, works to a point. It does what
I want it to, but the one thing that has disappeared is that I had a X, which
when you clicked on it it closed the information. What seems to have
replaced that , when I look in Frontpage is that there is now a flag which
would take it to the alternative page if javascript was disabled.

I realise that if a user clicks on another part of the page the information
will go, but is there a way a user can close the information without clicking
on another part of the page, ie have the X back which they can click?
 
S

Stefan B Rusynko

Your JavaScript for the close_all function needs to check the state (open or closed) and run the reverse

--




| Using the code you or Stefan have suggested, works to a point. It does what
| I want it to, but the one thing that has disappeared is that I had a X, which
| when you clicked on it it closed the information. What seems to have
| replaced that , when I look in Frontpage is that there is now a flag which
| would take it to the alternative page if javascript was disabled.
|
| I realise that if a user clicks on another part of the page the information
| will go, but is there a way a user can close the information without clicking
| on another part of the page, ie have the X back which they can click?
|
| --
| Sharon a users of Frontpage, but no coding experience
|
|
| "Murray" wrote:
|
| > <A href="thealternatepage.htm" target="_blank" onclick="close_all();return
| > false">
| >
| > Right? Otherwise, both would fire.
| >
| > --
| > Murray
| > ============
| >
| > | > > That is why you should never just have a JavaScript link as in
| > > <A href="JavaScript:close_all();">
| > > But you should have a std hyperlink w/ a JavaScript onclick event (which
| > > will fire if JS is not disabled)
| > > <A href="thealternatepage.htm" target="_blank" onclick="close_all();">
| > >
| > > --
| > >
| > > _____________________________________________
| > > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > > "Warning - Using the F1 Key will not break anything!" (-;
| > > To find the best Newsgroup for FrontPage support see:
| > > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > > _____________________________________________
| > >
| > >
| > > message
| > > | > > |I am currently using Frontpage 2003. I have a JavaScript function that
| > > makes
| > > | certain information appear on a page when a hyperlink is clicked. Due
| > > to the
| > > | fact that users may turn off JavaScript, I am looking for advise that
| > > will
| > > | enable me to have an alternative.
| > > |
| > > | the function I am using is:
| > > |
| > > | <SCRIPT type=text/javascript>
| > > | function close_all() {
| > > | document.getElementById('relatedprocess').style.display = 'none';
| > > | document.getElementById('tailoringguide').style.display = 'none';
| > > | }
| > > | function show_div(div_id) {
| > > | close_all();
| > > | document.getElementById(div_id).style.display = 'block';
| > > | }
| > > | </SCRIPT>
| > > |
| > > | and at the appropriate place for the hyperlink I put the following in:
| > > |
| > > | <DIV id=tailoringguide style="DISPLAY: none">
| > > | <TABLE cellSpacing=0 cellPadding=5 width="100%" border=0
| > > id="table29">
| > > | <TBODY>
| > > | <TR bgColor=#a50042>
| > > | <TD width="100%" bgcolor="#541586"><FONT face=arial color=white
| > > | size=2><B>? </B></FONT>
| > > | <b><font face="arial" size="2" color="#FFFFFF">Tailoring
| > > | Guide</font></b></TD>
| > > | <TD bgcolor="#541486"><A href="javascript:close_all();">
| > > | <IMG
| > > | src="x.gif" border=0 width="10" height="10"></A></TD></TR>
| > > | <TR>
| > > | <TD colSpan=2><font size="2">For smaller projects the PM will
| > > | normally perform many (or
| > > | all) of the other roles within the team,.........
| > > |
| > > | I know I can create a separate page with the same information on, what I
| > > do
| > > | not know is what alternative coding I need and where to put it, so that
| > > when
| > > | a user click the same hyperlink, they still get the same information, if
| > > they
| > > | disable JavaScript.
| > > |
| > > | Hope someone can help me?
| > > | --
| > > | Sharon a users of Frontpage, but no coding experience
| > >
| > >
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top