f



tricky javascript problem requires javascript guru !

Hi,

I am complete JavaScript novice and would really appreciate some help with
this code:

=====================================================================

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!--#include file="Connections/ssdb.asp" -->
<%
Dim rs_news_edit
Dim rs_news_edit_numRows

Set rs_news_edit = Server.CreateObject("ADODB.Recordset")
rs_news_edit.ActiveConnection = MM_ssdb_STRING
rs_news_edit.Source = "SELECT * FROM tblnews"
rs_news_edit.CursorType = 0
rs_news_edit.CursorLocation = 2
rs_news_edit.LockType = 1
rs_news_edit.Open()

rs_news_edit_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rs_news_edit_numRows = rs_news_edit_numRows + Repeat1__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL
and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
  MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & MM_nextItem &
Server.URLencode(Request.QueryString(MM_item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & MM_nextItem &
Server.URLencode(Request.Form(MM_item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the
strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
  MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "")  Then
  MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
  MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<html>
<head>
<title>ss</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>
..showSwitch {
 display: block;
 font-family: Georgia, "Times New Roman", Times, serif;
 color: #FF0000;
}
..hideSwitch {
 display: none;
 font-family: Georgia, "Times New Roman", Times, serif;
 color: #FF0000;
}
</style>

<script>

function showHideSwitch2 (theid, value) {
  if (document.getElementById) {
    switch_id = document.getElementById(theid);
    if (value == 'show') {
     switch_id.className = 'showSwitch';
    }else{  switch_id.className = 'hideSwitch';
    }
  }
}

</script>


<style type="text/css">
<!--
-->
</style>

</head>
<body background="Images/BG.jpg">
<table width="100%" height="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
  <tr>
    <td align="center" valign="middle">
<table width="700" height="600" border="1" align="center" cellpadding="0"
cellspacing="0" bordercolor="#B1D3EC">
        <tr>
          <td bgcolor="#FFFFFF">
            <table width="100%" height="100%" border="0" align="center"
cellpadding="0" cellspacing="0">
              <tr>
                <td><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img
src="Images/edit_news.jpg" width="142" height="40"></div></td>
              </tr>
              <tr>
                <td><p align="center">&nbsp;</p>
                  <p align="left">&nbsp;</p>
                  <table width="95%" border="0" align="center"
cellpadding="0" cellspacing="0">
                    <%
While ((Repeat1__numRows <> 0) AND (NOT rs_news_edit.EOF))
%>
                    <tr>
                      <td width="28%"><p
align="left"><%=(rs_news_edit.Fields.Item("news_summary").Value)%></p>
                        <p>&nbsp;</p></td>
                      <td width="28%"><div align="center">

<p><%=(rs_news_edit.Fields.Item("news_complete").Value)%></p>
                          <p>&nbsp;</p>
                        </div></td>
                      <td width="28%">&nbsp;</td>
                      <td width="16%">
                        <div align="center">
                          <p align="right"><a href="edit_news_01.asp?<%=
MM_keepURL & MM_joinChar(MM_keepURL) & "id=" &
rs_news_edit.Fields.Item("id").Value %>">Change</a>
                          </p>
                          <p>&nbsp; </p>
                        </div></td>
                    </tr>
                    <tr>
                      <td colspan="4"><p align="left"><a href="javascript:;"
onClick="showHideSwitch2('switch4', 'show')">open
4</a>
<a href="javascript:;" onClick="showHideSwitch2('switch4', 'hide')">close
4</a>
<p class="hideSwitch" id="switch4"><table width="75%" border="1"
align="center">
                          <tr>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                          </tr>
                          <tr>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                          </tr>
                          <tr>
                            <td>1</td>
                            <td>1</td>
                            <td>1</td>
                          </tr>
                        </table></p></p>
                        </td>
                    </tr>
                    <tr>
                      <td colspan="4"><hr></td>
                    </tr>
                    <tr>
                      <td colspan="4">&nbsp;</td>
                    </tr>
                    <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs_news_edit.MoveNext()
Wend
%>
                  </table>
                  <p align="center">&nbsp;</p>
                  <p align="center">&nbsp;</p>
                  <p align="center">&nbsp;</p>
                  <p align="center">&nbsp;</p>
                  <p align="center">&nbsp;</p></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td height="10" bgcolor="#B1D3EC">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
<%
rs_news_edit.Close()
Set rs_news_edit = Nothing
%>


=====================================================================

The problem is that the table with the '1's in it does not appear in each
repeat region bit, so for example if you clicked on the 5th repeated region
section the table would still open in the first section with the included
dynamic data also from the first item

Is there anyway I can fix this ?

Thanks in advance,

Andy.



0
andyww14 (11)
3/4/2004 7:20:22 PM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

3 Replies
1127 Views

Similar Articles

[PageSpeed] 46

Andy wrote:
> Hi,
>
> I am complete JavaScript novice and would really appreciate some help
> with this code:
>
> =====================================================================
>
> <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
>
> <!--#include file="Connections/ssdb.asp" -->
> <%
> Dim rs_news_edit
> Dim rs_news_edit_numRows
>
> Set rs_news_edit = Server.CreateObject("ADODB.Recordset")
> rs_news_edit.ActiveConnection = MM_ssdb_STRING
> rs_news_edit.Source = "SELECT * FROM tblnews"
> rs_news_edit.CursorType = 0
> rs_news_edit.CursorLocation = 2
> rs_news_edit.LockType = 1
> rs_news_edit.Open()
>
> rs_news_edit_numRows = 0
> %>
> <%
> Dim Repeat1__numRows
> Dim Repeat1__index
>
> Repeat1__numRows = -1
> Repeat1__index = 0
> rs_news_edit_numRows = rs_news_edit_numRows + Repeat1__numRows
> %>
> <%
> Dim MM_paramName
> %>
> <%
> ' *** Go To Record and Move To Record: create strings for maintaining
> URL and Form parameters
>
> Dim MM_keepNone
> Dim MM_keepURL
> Dim MM_keepForm
> Dim MM_keepBoth
>
> Dim MM_removeList
> Dim MM_item
> Dim MM_nextItem
>
> ' create the list of parameters which should not be maintained
> MM_removeList = "&index="
> If (MM_paramName <> "") Then
>   MM_removeList = MM_removeList & "&" & MM_paramName & "="
> End If
>
> MM_keepURL=""
> MM_keepForm=""
> MM_keepBoth=""
> MM_keepNone=""
>
> ' add the URL parameters to the MM_keepURL string
> For Each MM_item In Request.QueryString
>   MM_nextItem = "&" & MM_item & "="
>   If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
>     MM_keepURL = MM_keepURL & MM_nextItem &
> Server.URLencode(Request.QueryString(MM_item))
>   End If
> Next
>
> ' add the Form variables to the MM_keepForm string
> For Each MM_item In Request.Form
>   MM_nextItem = "&" & MM_item & "="
>   If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
>     MM_keepForm = MM_keepForm & MM_nextItem &
> Server.URLencode(Request.Form(MM_item))
>   End If
> Next
>
> ' create the Form + URL string and remove the intial '&' from each of
> the strings
> MM_keepBoth = MM_keepURL & MM_keepForm
> If (MM_keepBoth <> "") Then
>   MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
> End If
> If (MM_keepURL <> "")  Then
>   MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
> End If
> If (MM_keepForm <> "") Then
>   MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
> End If
>
> ' a utility function used for adding additional parameters to these
> strings Function MM_joinChar(firstItem)
>   If (firstItem <> "") Then
>     MM_joinChar = "&"
>   Else
>     MM_joinChar = ""
>   End If
> End Function
> %>
> <html>
> <head>
> <title>ss</title>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
>
> <style>
> .showSwitch {
>  display: block;
>  font-family: Georgia, "Times New Roman", Times, serif;
>  color: #FF0000;
> }
> .hideSwitch {
>  display: none;
>  font-family: Georgia, "Times New Roman", Times, serif;
>  color: #FF0000;
> }
> </style>
>
> <script>
>
> function showHideSwitch2 (theid, value) {
>   if (document.getElementById) {
>     switch_id = document.getElementById(theid);
>     if (value == 'show') {
>      switch_id.className = 'showSwitch';
>     }else{  switch_id.className = 'hideSwitch';
>     }
>   }
> }
>
> </script>
>
>
> <style type="text/css">
> <!--
> -->
> </style>
>
> </head>
> <body background="Images/BG.jpg">
> <table width="100%" height="100%" border="0" align="center"
> cellpadding="0" cellspacing="0">
>   <tr>
>     <td align="center" valign="middle">
> <table width="700" height="600" border="1" align="center"
> cellpadding="0" cellspacing="0" bordercolor="#B1D3EC">
>         <tr>
>           <td bgcolor="#FFFFFF">
>             <table width="100%" height="100%" border="0"
> align="center" cellpadding="0" cellspacing="0">
>               <tr>
>                 <td><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img
> src="Images/edit_news.jpg" width="142" height="40"></div></td>
>               </tr>
>               <tr>
>                 <td><p align="center">&nbsp;</p>
>                   <p align="left">&nbsp;</p>
>                   <table width="95%" border="0" align="center"
> cellpadding="0" cellspacing="0">
>                     <%
> While ((Repeat1__numRows <> 0) AND (NOT rs_news_edit.EOF))
> %>
>                     <tr>
>                       <td width="28%"><p
> align="left"><%=(rs_news_edit.Fields.Item("news_summary").Value)%></p>
>                         <p>&nbsp;</p></td>
>                       <td width="28%"><div align="center">
>
> <p><%=(rs_news_edit.Fields.Item("news_complete").Value)%></p>
>                           <p>&nbsp;</p>
>                         </div></td>
>                       <td width="28%">&nbsp;</td>
>                       <td width="16%">
>                         <div align="center">
>                           <p align="right"><a
> href="edit_news_01.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) &
> "id=" & rs_news_edit.Fields.Item("id").Value %>">Change</a>
>                           </p>
>                           <p>&nbsp; </p>
>                         </div></td>
>                     </tr>
>                     <tr>
>                       <td colspan="4"><p align="left"><a
> href="javascript:;" onClick="showHideSwitch2('switch4', 'show')">open
> 4</a>
> <a href="javascript:;" onClick="showHideSwitch2('switch4',
> 'hide')">close 4</a>
> <p class="hideSwitch" id="switch4"><table width="75%" border="1"
> align="center">
>                           <tr>
>                             <td>1</td>
>                             <td>1</td>
>                             <td>1</td>
>                           </tr>
>                           <tr>
>                             <td>1</td>
>                             <td>1</td>
>                             <td>1</td>
>                           </tr>
>                           <tr>
>                             <td>1</td>
>                             <td>1</td>
>                             <td>1</td>
>                           </tr>
>                         </table></p></p>
>                         </td>
>                     </tr>
>                     <tr>
>                       <td colspan="4"><hr></td>
>                     </tr>
>                     <tr>
>                       <td colspan="4">&nbsp;</td>
>                     </tr>
>                     <%
>   Repeat1__index=Repeat1__index+1
>   Repeat1__numRows=Repeat1__numRows-1
>   rs_news_edit.MoveNext()
> Wend
> %>
>                   </table>
>                   <p align="center">&nbsp;</p>
>                   <p align="center">&nbsp;</p>
>                   <p align="center">&nbsp;</p>
>                   <p align="center">&nbsp;</p>
>                   <p align="center">&nbsp;</p></td>
>               </tr>
>             </table></td>
>         </tr>
>         <tr>
>           <td height="10" bgcolor="#B1D3EC">&nbsp;</td>
>         </tr>
>       </table></td>
>   </tr>
> </table>
> </body>
> </html>
> <%
> rs_news_edit.Close()
> Set rs_news_edit = Nothing
> %>
>
>
> =====================================================================
>
> The problem is that the table with the '1's in it does not appear in
> each repeat region bit, so for example if you clicked on the 5th
> repeated region section the table would still open in the first
> section with the included dynamic data also from the first item
>
> Is there anyway I can fix this ?
>
> Thanks in advance,
>
> Andy.

Andy this is VBScript.
This post has been copied to microsoft.public.scripting.vbscript, check
there for a reply.
Follow-ups have been set to microsoft.public.scripting.vbscript only.
-- 
Andrew Urquhart
- FAQ: http://jibbering.com/faq
- Archive: http://groups.google.com/groups?group=comp.lang.javascript
- Reply: www.andrewu.co.uk/about/contact/


0
Andrew
3/4/2004 7:26:59 PM
Hi Andrew,

The VBscript is for the ASP code, there is a little JavaScript within
section of code that controls the show hide aspect of website, its this I
hope to fix.

Thanks

Andy.

"Andrew Urquhart" <reply@website.in.sig> wrote in message
news:6pL1c.650$54.540@newsfe1-win...
> Andy wrote:
> > Hi,
> >
> > I am complete JavaScript novice and would really appreciate some help
> > with this code:
> >
> > =====================================================================
> >
> > <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
> >
> > <!--#include file="Connections/ssdb.asp" -->
> > <%
> > Dim rs_news_edit
> > Dim rs_news_edit_numRows
> >
> > Set rs_news_edit = Server.CreateObject("ADODB.Recordset")
> > rs_news_edit.ActiveConnection = MM_ssdb_STRING
> > rs_news_edit.Source = "SELECT * FROM tblnews"
> > rs_news_edit.CursorType = 0
> > rs_news_edit.CursorLocation = 2
> > rs_news_edit.LockType = 1
> > rs_news_edit.Open()
> >
> > rs_news_edit_numRows = 0
> > %>
> > <%
> > Dim Repeat1__numRows
> > Dim Repeat1__index
> >
> > Repeat1__numRows = -1
> > Repeat1__index = 0
> > rs_news_edit_numRows = rs_news_edit_numRows + Repeat1__numRows
> > %>
> > <%
> > Dim MM_paramName
> > %>
> > <%
> > ' *** Go To Record and Move To Record: create strings for maintaining
> > URL and Form parameters
> >
> > Dim MM_keepNone
> > Dim MM_keepURL
> > Dim MM_keepForm
> > Dim MM_keepBoth
> >
> > Dim MM_removeList
> > Dim MM_item
> > Dim MM_nextItem
> >
> > ' create the list of parameters which should not be maintained
> > MM_removeList = "&index="
> > If (MM_paramName <> "") Then
> >   MM_removeList = MM_removeList & "&" & MM_paramName & "="
> > End If
> >
> > MM_keepURL=""
> > MM_keepForm=""
> > MM_keepBoth=""
> > MM_keepNone=""
> >
> > ' add the URL parameters to the MM_keepURL string
> > For Each MM_item In Request.QueryString
> >   MM_nextItem = "&" & MM_item & "="
> >   If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
> >     MM_keepURL = MM_keepURL & MM_nextItem &
> > Server.URLencode(Request.QueryString(MM_item))
> >   End If
> > Next
> >
> > ' add the Form variables to the MM_keepForm string
> > For Each MM_item In Request.Form
> >   MM_nextItem = "&" & MM_item & "="
> >   If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
> >     MM_keepForm = MM_keepForm & MM_nextItem &
> > Server.URLencode(Request.Form(MM_item))
> >   End If
> > Next
> >
> > ' create the Form + URL string and remove the intial '&' from each of
> > the strings
> > MM_keepBoth = MM_keepURL & MM_keepForm
> > If (MM_keepBoth <> "") Then
> >   MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
> > End If
> > If (MM_keepURL <> "")  Then
> >   MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
> > End If
> > If (MM_keepForm <> "") Then
> >   MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
> > End If
> >
> > ' a utility function used for adding additional parameters to these
> > strings Function MM_joinChar(firstItem)
> >   If (firstItem <> "") Then
> >     MM_joinChar = "&"
> >   Else
> >     MM_joinChar = ""
> >   End If
> > End Function
> > %>
> > <html>
> > <head>
> > <title>ss</title>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=iso-8859-1">
> >
> > <style>
> > .showSwitch {
> >  display: block;
> >  font-family: Georgia, "Times New Roman", Times, serif;
> >  color: #FF0000;
> > }
> > .hideSwitch {
> >  display: none;
> >  font-family: Georgia, "Times New Roman", Times, serif;
> >  color: #FF0000;
> > }
> > </style>
> >
> > <script>
> >
> > function showHideSwitch2 (theid, value) {
> >   if (document.getElementById) {
> >     switch_id = document.getElementById(theid);
> >     if (value == 'show') {
> >      switch_id.className = 'showSwitch';
> >     }else{  switch_id.className = 'hideSwitch';
> >     }
> >   }
> > }
> >
> > </script>
> >
> >
> > <style type="text/css">
> > <!--
> > -->
> > </style>
> >
> > </head>
> > <body background="Images/BG.jpg">
> > <table width="100%" height="100%" border="0" align="center"
> > cellpadding="0" cellspacing="0">
> >   <tr>
> >     <td align="center" valign="middle">
> > <table width="700" height="600" border="1" align="center"
> > cellpadding="0" cellspacing="0" bordercolor="#B1D3EC">
> >         <tr>
> >           <td bgcolor="#FFFFFF">
> >             <table width="100%" height="100%" border="0"
> > align="center" cellpadding="0" cellspacing="0">
> >               <tr>
> >                 <td><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img
> > src="Images/edit_news.jpg" width="142" height="40"></div></td>
> >               </tr>
> >               <tr>
> >                 <td><p align="center">&nbsp;</p>
> >                   <p align="left">&nbsp;</p>
> >                   <table width="95%" border="0" align="center"
> > cellpadding="0" cellspacing="0">
> >                     <%
> > While ((Repeat1__numRows <> 0) AND (NOT rs_news_edit.EOF))
> > %>
> >                     <tr>
> >                       <td width="28%"><p
> > align="left"><%=(rs_news_edit.Fields.Item("news_summary").Value)%></p>
> >                         <p>&nbsp;</p></td>
> >                       <td width="28%"><div align="center">
> >
> > <p><%=(rs_news_edit.Fields.Item("news_complete").Value)%></p>
> >                           <p>&nbsp;</p>
> >                         </div></td>
> >                       <td width="28%">&nbsp;</td>
> >                       <td width="16%">
> >                         <div align="center">
> >                           <p align="right"><a
> > href="edit_news_01.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) &
> > "id=" & rs_news_edit.Fields.Item("id").Value %>">Change</a>
> >                           </p>
> >                           <p>&nbsp; </p>
> >                         </div></td>
> >                     </tr>
> >                     <tr>
> >                       <td colspan="4"><p align="left"><a
> > href="javascript:;" onClick="showHideSwitch2('switch4', 'show')">open
> > 4</a>
> > <a href="javascript:;" onClick="showHideSwitch2('switch4',
> > 'hide')">close 4</a>
> > <p class="hideSwitch" id="switch4"><table width="75%" border="1"
> > align="center">
> >                           <tr>
> >                             <td>1</td>
> >                             <td>1</td>
> >                             <td>1</td>
> >                           </tr>
> >                           <tr>
> >                             <td>1</td>
> >                             <td>1</td>
> >                             <td>1</td>
> >                           </tr>
> >                           <tr>
> >                             <td>1</td>
> >                             <td>1</td>
> >                             <td>1</td>
> >                           </tr>
> >                         </table></p></p>
> >                         </td>
> >                     </tr>
> >                     <tr>
> >                       <td colspan="4"><hr></td>
> >                     </tr>
> >                     <tr>
> >                       <td colspan="4">&nbsp;</td>
> >                     </tr>
> >                     <%
> >   Repeat1__index=Repeat1__index+1
> >   Repeat1__numRows=Repeat1__numRows-1
> >   rs_news_edit.MoveNext()
> > Wend
> > %>
> >                   </table>
> >                   <p align="center">&nbsp;</p>
> >                   <p align="center">&nbsp;</p>
> >                   <p align="center">&nbsp;</p>
> >                   <p align="center">&nbsp;</p>
> >                   <p align="center">&nbsp;</p></td>
> >               </tr>
> >             </table></td>
> >         </tr>
> >         <tr>
> >           <td height="10" bgcolor="#B1D3EC">&nbsp;</td>
> >         </tr>
> >       </table></td>
> >   </tr>
> > </table>
> > </body>
> > </html>
> > <%
> > rs_news_edit.Close()
> > Set rs_news_edit = Nothing
> > %>
> >
> >
> > =====================================================================
> >
> > The problem is that the table with the '1's in it does not appear in
> > each repeat region bit, so for example if you clicked on the 5th
> > repeated region section the table would still open in the first
> > section with the included dynamic data also from the first item
> >
> > Is there anyway I can fix this ?
> >
> > Thanks in advance,
> >
> > Andy.
>
> Andy this is VBScript.
> This post has been copied to microsoft.public.scripting.vbscript, check
> there for a reply.
> Follow-ups have been set to microsoft.public.scripting.vbscript only.
> --
> Andrew Urquhart
> - FAQ: http://jibbering.com/faq
> - Archive: http://groups.google.com/groups?group=comp.lang.javascript
> - Reply: www.andrewu.co.uk/about/contact/
>
>


0
Andy
3/4/2004 7:47:37 PM
In article <404787d5$0$24358$cc9e4d1f@news.dial.pipex.com>, andyww14
@hotmail.com enlightened us with...
> 
> Hi Andrew,
> 
> The VBscript is for the ASP code, there is a little JavaScript within
> section of code that controls the show hide aspect of website, its this I
> hope to fix.
> 

Then copy and paste the code as the browser sees it. With View->Source. 
Preferably in a smaller bit of code that simply demonstrates the 
javascript problem so we can copy and paste it and play with it.

You expect us to know VBScript?  ;)
(actually having the script there is confusing if it is a JS problem, 
because we don't see what the browser sees, so how can we fix it?)

From what I can tell, though, the name is hardcoded as 
<a href="javascript:;" onClick="showHideSwitch2('switch4', 'hide')">

Well, if that piece repeats as it shows, the same div will be passed for 
every click. So that same div will be hidden and shown every time.
Check the real source to see.

-- 
--
~kaeli~
Santa's helpers are subordinate clauses.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

0
kaeli
3/4/2004 8:19:11 PM
Reply:

Similar Artilces:

javascript within a javascript
Hello, I have a multi-frame page. The frames are named Frame_1, Frame_2 and Frame_3. Frame_1 has a drop down box. When a value is selected in this drop down box, Frame_2 is updated using an asp file (as I have to read from a back-end access database). In turn in the asp file, I have a Body onload tag to execute a javascript function within Frame_2. this function updates the contents of Frame_3. Till now this is working fine. Here is the problem. Frame_3 has a form with a radio button. When a radio button is selected, I want that a function be executed in Frame_3. However since conte...

Does all javascript (like location.href) require that javascript be declared?
Hi everyone, I am in the process of learning javascript and have a question on location.href. Does javascript always require the <script language = "javascript"> (or script type="text/javascript">) to run? I'm asking because the following chunk of code (drop down menu that goes to different parts of the page) works without declaring anywhere that it's javascript: <form> <select name="Library" onchange="location.href=this.form.Library[this.form.Library.selectedIndex].value"> <option value="#First">Fi...

Javascript and IE? Javascript and C#?
While my question might be simple, the environment around it is terribly messy and so I will try to keep this clear and simple by only including the relevant code - however, as I will soon suggest, I worry that the problem isnt in what would seem to be the relevant code but instead is lost somewhere in the do-and-donts of the peripheral code. So at the end, i'll try to include all the affected code and you can see if any of its actually relevant. I know there is a lot going on... sorry, but I tried to write this clearly. So here is what I imagine to be relevant. I'm working with a page that uses a very simple javascript function change the style of an <li> element (display=block;). The code is simple...which is why I cant understand my problem. This function is being called by <body onload="fop()"> // Javascript function function fop() { var dropDown = document.getElementById("region"); var firstName = dropDown.name; var fload = document.getElementById(firstName); fload.style.display = "block"; } // This is where it grabs the name value. "View Source" confrims the values work, (eg. name="ZHT") <select name="<%=Request.QueryString("lang")%>" id="region" onchange="selectMenu();"> //This is one of the <li> tags <li class="operatorLI" id="ZHT"> // Later for testing, I tried this (see below) <li class="op...

dynamic load javascript from javascript
hi, from here: http://www.activewidgets.com/javascript.forum.6114.15/dynamic-load-javascript-from-javascript.html there is a method to load js from js, e.g. //--------------------------------------------------------------------------------------- var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'snip.js'; document.getElementsByTagName('head')[0].appendChild(script); //--------------------------------------------------------------------------------------- this method works great, but there is a bug(?) when using wit...

javascript
Hi all I wounder if some one can help me i have to write a program that sums numbe3rs together using a for loop. The numbers are 1 to 10 then one to 20 then 1 to 10,000. // A program for summing numbers from one to biggestNumber Var biggestNumber; Var theSum = 0; its got to start like this. Im having problems with this one viicki -- v davies Message posted via JavaKB.com http://www.javakb.com/Uwe/Forums.aspx/java-tools/200512/1 On Fri, 16 Dec 2005 11:27:29 GMT, "vicki via JavaKB.com" <u16404@uwe> wrote, quoted or indirectly quoted someone who said : >// A program fo...

JavaScript
If I have Options/ViewingMail/AllowExecutables unchecked does Eudora strip out the JavaScript? Or just refuse to execute it? TIA... Bob "Bob Bailey" <ebiz@usa.net> wrote in message news:rfOdnaRVycZZNzXenZ2dnUVZ_v-dnZ2d@rcn.net... > If I have Options/ViewingMail/AllowExecutables unchecked does Eudora strip > out the JavaScript? Or just refuse to execute it? OK. I've answered my own question but that begs a new one. (Eudora strips the JS.) Having allowed Executables it only works if I open, not preview, the message and then it insists on ope...

JavaScript
Guys, anybody know if is possible "to press" a button linked a javascript function using python? My Firefox send something like that: POST /msgs.aspx TOKEN=B8B83BGDBC191B9FE0A0BE1393294FAB&sig=gpaiOqbp0Nr %2BoecRLF4FGGDOAao %3D&toUserId=1331299&rawAddedDate=1188546666&fromUserId=23029&Action.delete=Send +data python has modules for forms and other things... and for it? Thank you for help... zowtar >python has modules for forms and other things... and for it? Check out httplib and urlib2, it might be useful for you. Hi! I know "how to", but o...

Javascript
Hello people, I'm trying to make a regional map in html and javascript, I'm sure how to d= o the following: to hover over the city, he should change the city's image with another clea= rer, and clicking in the city he should get a darker color than the picture= when we hover. Until there all right, but when I click it gets darker image and move the m= ouse in another city he immediately removes the dark image and return to th= e clearer picture. How to keep the image when I click on it and still the effect of passing th= e mouse? --------------------- the other t...

javascript
Cut'n'paste from "my" ticket 202 at www.ecomstation.com as they seem to have come to a halt... :-( ################################ Recenty I went from w4 fp17 to eCS 1.2. I get the odd behavior described beneath. Both boxes sees, and uses the same installations and user profiles. Clean install(s) of both Moz and FF has been done several times. Starting FF or Moz clean (no userprofiles), doesn't make any differnce. FIREFOX: The Weather extension i.e doesn't show it's 'mouseover' info, and it refreshes slow. Unit change which ...

JavaScript
Javascript has it's own significance Amit Patel wrote: > Javascript has it's own significance Mr Patel, Stop using that stuff, it's bad for your brains. :P "Amit Patel" <amit2749@hotmail.com> wrote in message news:5f04ccb8.0401210427.3f93300c@posting.google.com... | Javascript has it's own significance It also has it's own group.. news:comp.lang.javascript ...

Nixing Javascript via javascript: pseudoproto?
This is a question about defensive web browsing. Ocassionally I run into a page whose JavaScript does something that I find obnoxious. I would like to turn off JavaScript only for that page (instead of disabling it globally). It would be cool if there were some way to do this through a "bookmarkable" JavaScript snippet using the javascript: pseudoprotocol. Does anyone know any trick to do any of this? Many thanks! -bill "bill" wrote > This is a question about defensive web browsing. Ocassionally I > run into a page whose JavaScript does something that I fi...

About Javascript.
I wish to know more about javascript. Hope that have somebody can help me solve this problem. Just tell me which types of javescript is easy to learn and easy to use. Thank. "Joanne" <Joanne_9989@yahoo.com.sg> wrote in message news:bi3ulh$id7$1@ftp.curtin.edu.au... > I wish to know more about javascript. Hope that have somebody can help me > solve this problem. Just tell me which types of javescript is easy to learn > and easy to use. Thank. There *technically* is only one type of javascript - so I would suggest learning that one - there is a great beginners prime...

** Dynamically writing html/javascript from a javascript function **
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with no luck though), and searched through the IRT.ORG Faqs (www.irt.org/script/script.htm). The Javascript is designed to open an popup window and then inside that window call another script which will resize that window. There may be another way around this but the reason I tried this approach initially was that I wanted to call the onload handler in the popup window to resize the image only after the image had completely loaded. I've had some code in the primary Javascript file (showimage.js) before that works if the image has been cached but on the first load, it doesn't resize properly which tells me it is probably because it is trying to resize the window based on the image size but it isn't completely known at that point. So I removed that code and tried placing the resizing code in the second Javascript file (resizewindow.js). BTW I've tried other code to open a popup image and automatically size it ie Q1443 at irt.org but that doesn't do exactly what we need. Even if there is another way to do this with one file, I still want to figure out why this isn't working in case I run into it in the future. I thought what I would need to do to use document.writeln to write Javascript would be to escape any special characters and to break apa...

where are the javascripts?
On the link below: http://www.zytrax.com/books/dns/ I couldn't find the javascript codes (mouseover) needed for the Dynamic HTML menu at the top of the page. How did the site hide those codes? -- .~. Might, Courage, Vision. In Linux We Trust. / v \ http://www.linux-sxs.org /( _ )\ Linux 2.4.22-xfs ^ ^ 9:04pm up 2 days 11:31 load average: 1.08 1.20 1.08 toylet wrote: > On the link below: > > http://www.zytrax.com/books/dns/ > > I couldn't find the javascript codes (mouseover) needed for the > Dynamic HTML menu at the top of the page. How did the ...

JavaScript?
I have a question, and I hope this one hasn't been asked too frequently; if so, I apologize in advance. I've heard over time that it isn't a good idea to intermingle JavaScript with PHP code. Maybe that's a fallacy, and maybe not, but if so, would someone care to enlighten me as to why this might be the case? Thanks in advance for any responses. -- Randy Jackson http://fourcolorexplosion.com On Sat, 10 Jul 2004 16:32:43 GMT, Randy Jackson <randyjackson@ignorethispartfourcolorexplosion.com> wrote: >I have a question, and I hope this one hasn't been asked t...

Javascript with %%%%%%?
Hi,I had this guy post some spam to my site and now I'm on a mission tofind out who it is. He's got a site that redirects you elsewhere, inthat site I hit stop on the browser so I could see it. It containedthis script:SCRIPT type='text/javascript'>var ibnfbpy="%3c%73c%72%69pt%20"+""+"%74%79"+"p%65%3d%27%74ex"+"%74%2f%6a%61%76%61s%63%72%69%70%74%27%3e%0a%77i%6ed%6f%77%2e%6c%6f%63a%74%69%6fn%2e%68%72ef%3d%22%68t%74%70%"+"3a%2f%2f"+"%78%61%6e%61x%37%37%37"+"%70%69%6c%6c%73%2e%63o%6d%2f%71%2eph%"+&...

Javascript Caret Position in DIV
Hi All, I am looking for a way to get and set the caret position in an editable DIV. I have tried using the TextRange option, this is using the document.selection.createRange() function. The problem is that the TextRange object is sometimes shared in memory, and consequently one modification of the TextRange will affect another. I am using this to implement a javascript clipboard, so I have to be able to save the TextRange objects to restore any changes made to the DIV content when the user hits CTRL Z. Alternately, does anyone know of a good javascript clipboard? The default one does not ...

Tricky javascript/activex object problem
This is a multi-part message in MIME format. ------=_NextPart_000_001C_01C44D87.C1A22810 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The following script if run in Internet Explorer should display a thumbview of a webpage that you point it to. To test it, replace test.htm with a valid html file. The problem I'm having is that I can't get onclick to fire on the rendered Thumbview object. What's strange is that onmouseover fires. Can anyone see a way? <html><head><title>test</title></head> <body onload=3D"Init()"> <a onclick=3Dalert() href=3D"file:///C:/test.htm"> <object id=3D"Thumbview"=20 classid=3D"clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92" width=3D120 height=3D100 onclick=3Dalert()> </object><br><br>this works </a> <script> function Init(){ Thumbview.displayFile('C:\\test.htm'); } </script> </body></html> ------=_NextPart_000_001C_01C44D87.C1A22810 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR> <STYLE></STYLE> </HEAD>...

assigning session a javascript value in javascript function
Hello Guyz.. I want to assign a varascript value to a session object in javascript function... like i have an image and onClick i am calling a function sort_(str).. Now i want to assign this value str to a session object in the same function... I know javascript code is client side and session is on server side.. but is there any way doing that?? function sort_(str) { document.ins_form.elements["Qry"].value = str; //alert(str); document.form1.submit(); } when i click on that image and that function calls everything works fine. but when i click on next to bring more records i c...

Javascript Problem!
I am developing a site at http://www.nwlmi.org.uk The problem lies with the CSS/XHTML Menu which relies on JavaScript to open and close the sections. The parent sections open and close fine but when you click on one of the subsection items and go to the desired page the menu fails to remain open. The javascript code is embeded inthe html for reference. Is this a JS issue I wonder. The original script/code derived from Alsacreations but there is no documentation to aid this problem. Thanks in advance for any tips :) Chris cedwa wrote: > I am developing a site at http://www.nwlmi.org....

Javascript problem.
Try out the code below in an HTML file please. The problem is with the javascript. I can't get the body to change. The code below is PHP generated. Firefox says the problem is show() does not exist AFTER I click on the link display[ link displayed says: test ] <html> <script> function show( s ){ document.write("<table><tr><td>"+ body( s ) +"</td></tr></table>"); return 0; } function body( s ){ t = ' '; if ( s == "home" ){ t += "hi home<BR><BR>";t += "<a href=\&quo...

The JavaScript Planet! There are now 789 JavaScripts available
WELCOME to The JAVASCRIPT PLANET which is a page where I plan to publish as many JavaScripts (and maybe some other cool stuff like VRML, Animated GIFs) as possible, please contribute a JavaScript if you've got something useful. Just paste the code into the textbox and push the Send button! Your contribution will be published on a separate page, with your name and comment, within a week (usually). ...

Including a javascript relative to its own location from another javascript
Hello, I want to include a javascript from another javascript. I know that I can do that by document.write("<script src='another.js'>"); I am exposing my main.js (which contains the above code) directly, intending it to be used via cross-site scripting (xss). In this case, the above code doesn't work. Because an external html which is using my main.js will look for another.js in its local directory. I have to change 'another.js' to '<absolute path>/another.js' for it to work. But now if I change the location of main.js I have to make chang...

Javascript?
Why is it that we can not have Javascript on RiscOS? Simply please. Dave. -- D In message <27bce4234f.David@mail.daveandsylvia.plus.com> Dave <mail@daveandsylvia.plus.com> wrote: > Why is it that we can not have Javascript on RiscOS? Simply please. > Dave. We do have Javascript: - Firefox Oregano 1 and 2 WebsterXL Fresco I believe with the exception of Firefox, all the other browsers feature either incomplete or non current versions of Javascript Someone please feel free to correct me, but I do not believe any of the above browsers are ...

Web resources about - tricky javascript problem requires javascript guru ! - comp.lang.javascript

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

Lightbox (JavaScript) - Wikipedia, the free encyclopedia
On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
about dmoz - help Top : Computers : Programming : Languages : JavaScript : Tools : Obfuscators Tools for obfuscation/compression JavaScript code. ...

Facebook Open-Sources JavaScript Static-Type Checker Flow
The latest software to be open-sourced by Facebook is Flow , a static-type checker for JavaScript . (more…) New Career Opportunities Daily: ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

Quickstart: Facebook SDK for JavaScript
This quickstart will show you how to setup the SDK, load social plugins, trigger a dialog, and get it to make some basic Graph API calls.

Facebook App Devs Get Javascript
It has been an oft-lamented fact of the Facebook Platform thus far in its life that, in order to use all but the most simple of Javascript functionality–the ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken . blog.mozilla.org/research/2014/… ...

Resources last updated: 3/12/2016 7:57:05 AM