[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

4.6

changing images

Asked by zoonon in JavaScript

Tags: javascript

Hi

I'm a Java programmer wich have been "forced" to do some web development, with mixed results. I have a problem with a page wich is supposed to show images wich change without refreshing based on user input. This is not working out so far. I can't seem to get the images to change. I think I've missed some basic principle on image handling. If you could help me get it to work or have some alternative solution I would be grateful. This is the relevant code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Produktsiden</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%
      'Establish connection
      Session("produkter") = "Provider=SQLOLEDB.1;Password=****;Persist Security Info=True;User ID=zoonon;Initial Catalog=BMC;Data Source=195.159.30.40"
      set conn = Server.CreateObject("ADODB.Connection")
      set rs = Server.CreateObject("ADODB.Recordset")
      conn.open Session("produkter")
      'sql queries
      sqlKat = "SELECT * FROM Kategorier WHERE aktiv = '1' "
      sqlProd = "SELECT * FROM PRODUKTER"
      sqlCountKat = "SELECT COUNT(*) AS TELL FROM PRODUKTER"
%>
<script language="JavaScript" type="text/javascript">
      //Global variables
      var arrayProdukter = new Array()
      var arrayKategorier = new Array()
      var arrayProduktBilder = new Array()
      var tmpProdukter = new Array()
      var teller = 0
</script>
<%
      'loop that fills arrays
      Set rs = conn.Execute(sqlProd)
      Do while not rs.EOF
%>
<script language="JavaScript" type="text/javascript">
      //fill arrays with data from database
      arrayProdukter[teller]=<%=rs("art_nr")%>
      arrayKategorier[teller]=<%=rs("kategori_id")%>
      arrayProduktBilder[teller]=<%=rs("bilde")%>
      tmpProdukter[teller]=<%=rs("bilde")%>
      teller++
</script>
<%
      rs.movenext
      Loop
%>
<script language="JavaScript" type="text/javascript">
function preloadImages()
{
      //preload images
      bilde1 = new image()
      bilde1.src = tmpProdukter[0]+".jpg"
      bilde2 = new image()
      bilde2.src = tmpProdukter[1]+".jpg"
      bilde3 = new image()
      bilde3.src = tmpProdukter[2]+".jpg"
      bilde4 = new image()
      bilde4.src = tmpProdukter[3]+".jpg"
      bilde5 = new image()
      bilde5.src = tmpProdukter[4]+".jpg"
      bilde6 = new image()
      bilde6.src = tmpProdukter[5]+".jpg"
      bilde7 = new image()
      bilde7.src = tmpProdukter[6]+".jpg"
      bilde8 = new image()
      bilde8.src = tmpProdukter[7]+".jpg"
      bilde9 = new image()
      bilde9.src = tmpProdukter[8]+".jpg"
}
function getProducts(selectedKategori)
{
      var j = 0
      for(var i=0;i<arrayProdukter.length;i++)
      {
            if((arrayKategorier[i] == selectedKategori) || (selectedKategori == 0))
            {
                  tmpProdukter[j] = arrayProduktBilder[i]
                  j++
            }
      }
      for (var i=0;i<9;i++)
      {
            bildenr = i+1
            document.grafisk["bilde"+bildenr+""].src=eval("tmpProdukter["+i+"]"+".jpg")
      }      
}
function showNext()
{
      //This will be the function for showing the next products in the tmpProdukter array
}
function showPreviouse()
{
      //This will be the function for showing the previouse products in the tmpProdukter array
}
</script>
</head>

<body onLoad="preloadImages()">      
<table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right">
      <%
            Set rs = conn.Execute(sqlKat)
    %>  
      <form method="get" name="selectkat">
      <SELECT name="kategori" onChange="getProducts(form.kategori.value)">
      <OPTION value="0">Alle kategorier</OPTION>
      <%
            Do while not rs.EOF
      %>
      <OPTION value="<%=rs("kategori_id")%>"><%=rs("kategori")%></OPTION>
      <%
            rs.movenext
            Loop
      %>
      </SELECT></form></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="5" cellpadding="0">
        <tr align="center" valign="middle">
          <td width="33%"><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde1" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)"width="120" height="120"></a></td>
          <td><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde2" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
          <td width="33%"><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde3" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
        </tr>
        <tr align="center" valign="middle">
          <td width="33%"><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg"  name="bilde4" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
          <td><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde5" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
          <td width="33%"><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde6" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
        </tr>
        <tr align="center" valign="middle">
          <td width="33%"><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde7" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
          <td><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde8" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
          <td width="33%"><a href="/grafisk/temp.html"></a><img src="grafisk/001.jpg" name="bilde9" alt="grafisk/blank.jpg" style="filter:blendTrans(duration=1)" width="120" height="120"></a></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="5" cellpadding="0">
        <tr>
          <td width="50%" align="center"><img src="grafisk/buttons/backknapp.gif" width="89" height="45" border="0"></td>
          <td align="center"><img src="grafisk/buttons/nextknapp.gif" width="89" height="45" border="0"></td>
        </tr>
      </table></td>
  </tr>
</table>

      
      
</body>
</html>
[+][-]09/08/03 04:42 AM, ID: 9308706Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/08/03 05:45 AM, ID: 9309059Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/08/03 06:11 AM, ID: 9309197Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/08/03 08:55 AM, ID: 9310250Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/09/03 12:18 AM, ID: 9316958Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/09/03 01:31 AM, ID: 9317752Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/09/03 04:05 AM, ID: 9319422Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/09/03 04:19 AM, ID: 9319499Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/09/03 04:43 AM, ID: 9319626Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/09/03 07:10 AM, ID: 9320506Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/09/03 07:12 AM, ID: 9320533Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/09/03 08:15 AM, ID: 9321129Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/03 12:49 AM, ID: 9326844Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/03 01:00 AM, ID: 9326890Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/03 06:08 AM, ID: 9328653Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/03 08:02 AM, ID: 9329500Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: JavaScript
Tags: javascript
Sign Up Now!
Solution Provided By: prohacx
Participating Experts: 1
Solution Grade: A
 
[+][-]09/10/03 09:09 AM, ID: 9330010Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/11/03 12:04 AM, ID: 9334872Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/23/03 07:08 AM, ID: 9413067Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/23/03 07:14 AM, ID: 9413119Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/23/03 11:17 PM, ID: 9418589Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/03 01:13 AM, ID: 9419053Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/25/03 05:05 AM, ID: 9427687Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89