innerHtml not working in Javascript

Change Page: 12 > | Showing page 1 of 2, messages 1 to 20 of 21
Author Message
Fredledingue

  • Total Posts : 572
  • Scores: 2
  • Reward points : 0
  • Joined: 5/9/2005
  • Location: Europe
  • Status: offline
innerHtml not working in Javascript Sunday, April 26, 2009 9:01 AM (permalink)
0
In fact it's working but the span (or div) is not refreshed upon execution.
I mean if I echo the innerHtml it returns the new html code, but keeps diplayiing the old one.
 
Strangly, innerText works without problem.
 
this the line causing problem:
document.all.MyPic.innerHtml = '<img src="' + FileList[PicNum] + '" id="MyPicture">' ;

 
this is the full script/html
 
I have a similar code in VBscripts which works like a charm, using almost the same code.
 
 <html>
 <head>
   <HTA:APPLICATION
  ID="PBrowser" 
     APPLICATIONNAME="PicViewer"
  NAVIGABLE="yes">
 
 <title>test pic browser js</title>
 <SCRIPT language="JavaScript" type="text/javascript">
 window.onload = function() {
 objTool = document.all.ToolBar;
 objToolBar = objTool.style;
 iTimerID = window.setInterval("DockToolBar()", 800);
 PictureWidth = document.all.MyPicture.width;
 PictureHeight = document.all.MyPicture.height;
 OriginalPictureWidth = PictureWidth;
 OriginalPictureHeight = PictureHeight;
 FileList =[];
 FileList[0]='pic00.jpg';
 FileList[1]='pic01.jpg';
 FileList[2]='pic02.jpg';
 FileList[3]='pic03.jpg';
 FileList[4]='pic04.jpg';
 FileList[5]='pic05.jpg';
 PicCount=5;
 PicNum=0;
 }
 function DockToolBar() {
 var ScrlTop = document.body.scrollTop;
  if (ScrlTop > 0){
  objToolBar.top = 10 + ScrlTop;}
  else if ( objToolBar.top.replace("px", "")  !=10 ){
   objToolBar.top = 10;}
 }
 function Zoom(MyVar){
  switch(MyVar){
  case 1:
  PictureWidth = Math.round(PictureWidth * 1.2);
  PictureHeight = Math.round(PictureHeight * 1.2);
  break;
  case 2:
  PictureWidth = OriginalPictureWidth;
  PictureHeight = OriginalPictureHeight;
  break;
  case 3:
  PictureWidth = Math.round(PictureWidth / 1.2);
  PictureHeight = Math.round(PictureHeight / 1.2);
  break;
  case 4:
  PictureHeight = Math.round((document.body.clientHeight)*0.9);
  PictureWidth = OriginalPictureWidth/(OriginalPictureHeight/PictureHeight);
  }
 document.all.MyPicture.width = PictureWidth;
 document.all.MyPicture.height = PictureHeight;
 }
 function AddPrev(i){
 var objPic = document.getElementById("Pic" + PicNum);
 objPic.border=0;
  if (i<10){
  PicNum = PicNum +i;
   if (PicNum > PicCount){
   PicNum=PicCount;}
   else if (PicNum == -1){
   PicNum=0;}
  }
  else {
  PicNum=i-10;}
  
  if (PicNum==0){
  document.form.BtnNext.disabled = false;
  document.form.BtnPrev.disabled = true;
  }
  else if (PicNum == PicCount){
  document.form.BtnNext.disabled = true;
  document.form.BtnPrev.disabled = false;
  }
  else {
  document.form.BtnNext.disabled = false;
  document.form.BtnPrev.disabled = false;
  }
 document.all.MyPic.innerHtml = '<img src="' + FileList[PicNum] + '" id="MyPicture">' ;
 //document.all.MyPic.reload
 //window.location.reload()
 objPic = document.getElementById("Pic" + PicNum);
 objPic.border=3;
 //alert(document.images.MyPicture.width + "-" + document.images.MyPicture.height);
 PictureWidth = document.images.MyPicture.width;
 PictureHeight = document.images.MyPicture.height;
 OriginalPictureWidth = PictureWidth;
 OriginalPictureHeight = PictureHeight;
 //alert(PictureWidth + ' - ' + PictureHeight)
 }
 </SCRIPT>
 </head>
 <body>
 <FORM NAME="form">
 <p align="center"><br><br><span id="MyPic"><img src="pic05.jpg" id="MyPicture"></span></p>
 <p id="ToolBar" align="justify"
  style="position: absolute; left: 5; top: 10; width: 640; height: 16; cursor='default'">
 <INPUT NAME="BtnZoomIn" ONCLICK="Zoom(1)" TYPE="BUTTON" VALUE="Zoom +">
 <INPUT NAME="BtnZoomOut" ONCLICK="Zoom(2)" TYPE="BUTTON" VALUE="100%">
 <INPUT NAME="BtnZoomOut" ONCLICK="Zoom(3)" TYPE="BUTTON" VALUE="Zoom -">
 <INPUT NAME="BtnPrev" ONCLICK="AddPrev(-1)" TYPE="BUTTON" VALUE="&#8592;">
 <INPUT NAME="BtnNext" ONCLICK="AddPrev(1)" TYPE="BUTTON" VALUE="&#8594;">
 </p>
 
 </FORM>
 <img src="pic00" id="Pic0" height="100" OnClick="AddPrev(10)"
   onmouseover="document.body.style.cursor='hand'"
   onmouseout="document.body.style.cursor='auto'">
 <img src="pic01.jpg" id="Pic1" height="100" OnClick="AddPrev(11)"
   onmouseover="document.body.style.cursor='hand'"
   onmouseout="document.body.style.cursor='auto'">
 <img src="pic02.jpg" id="Pic2" height="100" OnClick="AddPrev(12)"
   onmouseover="document.body.style.cursor='hand'"
   onmouseout="document.body.style.cursor='auto'">
 <img src="pic03.jpg" id="Pic3" height="100" OnClick="AddPrev(13)"
   onmouseover="document.body.style.cursor='hand'"
   onmouseout="document.body.style.cursor='auto'">
 <img src="pic04.jpg" id="Pic4" height="100" OnClick="AddPrev(14)"
   onmouseover="document.body.style.cursor='hand'"
   onmouseout="document.body.style.cursor='auto'">
 <img src="pic05.jpg" id="Pic5" height="100" OnClick="AddPrev(15)"
   onmouseover="document.body.style.cursor='hand'"
   onmouseout="document.body.style.cursor='auto'">
 </p>
 </body>
 </html>
 

 
 
Fred
 
#1
    TNO

    • Total Posts : 2094
    • Scores: 36
    • Reward points : 0
    • Joined: 12/18/2004
    • Location: Earth
    • Status: offline
    RE: innerHtml not working in Javascript Monday, April 27, 2009 2:41 AM (permalink)
    0
    The quick answer is that you don't have a  name attribute on the tag you are trying to reference. Use document.getElementById

    I'm not trying to hurt your feelings of course, but your code needs an overhaul. Here are just a few things at first glance that you could do

    First, use this as a template for your page:
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
     <html>
         <head>
             <title>Untitled Document</title>
             <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
             <hta:application
              id="PBrowser" 
              applicationname="PicViewer"
              navigable="yes"/>
     
             <style type="text/css">
     
             </style>
     
             <script type="text/javascript">
     
             </script>
         </head>
         <body>
             
         </body>
     </html>
     


    Next, for all those images at the bottom of your code, you can replace with some simple css

    change this:
     <img src="pic00" id="Pic0" height="100" OnClick="AddPrev(10)"
      onmouseover="document.body.style.cursor='hand'"
      onmouseout="document.body.style.cursor='auto'">
     <img src="pic01.jpg" id="Pic1" height="100" OnClick="AddPrev(11)"
      onmouseover="document.body.style.cursor='hand'"
      onmouseout="document.body.style.cursor='auto'">
     <img src="pic02.jpg" id="Pic2" height="100" OnClick="AddPrev(12)"
      onmouseover="document.body.style.cursor='hand'"
      onmouseout="document.body.style.cursor='auto'">
     <img src="pic03.jpg" id="Pic3" height="100" OnClick="AddPrev(13)"
      onmouseover="document.body.style.cursor='hand'"
      onmouseout="document.body.style.cursor='auto'">
     <img src="pic04.jpg" id="Pic4" height="100" OnClick="AddPrev(14)"
      onmouseover="document.body.style.cursor='hand'"
      onmouseout="document.body.style.cursor='auto'">
     <img src="pic05.jpg" id="Pic5" height="100" OnClick="AddPrev(15)"
      onmouseover="document.body.style.cursor='hand'"
      onmouseout="document.body.style.cursor='auto'">
     


    into this:
                 <img src="pic00.jpg" id="Pic0" OnClick="AddPrev(10)"/>
                 <img src="pic01.jpg" id="Pic1" OnClick="AddPrev(11)"/>
                 <img src="pic02.jpg" id="Pic2" OnClick="AddPrev(12)"/>
                 <img src="pic03.jpg" id="Pic3" OnClick="AddPrev(13)"/>
                 <img src="pic04.jpg" id="Pic4" OnClick="AddPrev(14)"/>
                 <img src="pic05.jpg" id="Pic5" OnClick="AddPrev(15)"/>
     


    and put this in the stylesheet:
                 img{
                     cursor:hand;
                     height:100px;
                 }
     


    You don't need the form tag, get rid of it.

    Replace all the name attributes with an id attribute.

    In your javascript add this function:

    function id(o){return document.getElementById(o)}

    In your code use that function to find elements instead. For example:
    document.all.MyPicture -> id("MyPicture")

    replace MyPicture.width with MyPicture.style.width and do the same for the height attribute

    replace window.onload with onload

    replace window.setInterval("DockToolBar()", 800); with setInterval(DockToolBar, 800);

    declare your variables or everything will be a global. instead of just using foo = "bar", use var foo = "bar"

    replace your array:
                     FileList =[];
                     FileList[0]='pic00.jpg';
                     FileList[1]='pic01.jpg';
                     FileList[2]='pic02.jpg';
                     FileList[3]='pic03.jpg';
                     FileList[4]='pic04.jpg';
                     FileList[5]='pic05.jpg';


    with this:
     var FileList =['pic00.jpg','pic01.jpg','pic02.jpg','pic03.jpg','pic04.jpg','pic05.jpg']
     


    replace this PicNum = PicNum + i; with this: PicNum += i;

    Take all your event listeners out of the code and move them into the onload event:

    replace this
                 <img src="pic00.jpg" id="Pic0" OnClick="AddPrev(10)"/>
                 <img src="pic01.jpg" id="Pic1" OnClick="AddPrev(11)"/>
                 <img src="pic02.jpg" id="Pic2" OnClick="AddPrev(12)"/>
                 <img src="pic03.jpg" id="Pic3" OnClick="AddPrev(13)"/>
                 <img src="pic04.jpg" id="Pic4" OnClick="AddPrev(14)"/>
                 <img src="pic05.jpg" id="Pic5" OnClick="AddPrev(15)"/>
     


    with this:
                 <img src="pic00.jpg" id="Pic0"/>
                 <img src="pic01.jpg" id="Pic1"/>
                 <img src="pic02.jpg" id="Pic2"/>
                 <img src="pic03.jpg" id="Pic3"/>
                 <img src="pic04.jpg" id="Pic4"/>
                 <img src="pic05.jpg" id="Pic5"/>
     


    add this to the script

    var Pic0, Pic1, Pic2,Pic3,Pic4,Pic5
    onload = function(){
        Pic0 = id("Pic0")
        Pic1 = id("Pic1")
        Pic2 = id("Pic2")
        Pic3 = id("Pic3")
        Pic4 = id("Pic4")
        Pic5 = id("Pic5")

        Pic0.onclick = function(){AddPrev(10)}
        Pic1.onclick = function(){AddPrev(11)}
        Pic2.onclick = function(){AddPrev(12)}
        Pic3.onclick = function(){AddPrev(13)}
        Pic4.onclick = function(){AddPrev(14)}
        Pic5.onclick = function(){AddPrev(15)}



    ...rest of your code
    }


    do similar to the other tag events. There may be some more but this is a good start I think. Your code will be smaller and easier to manage and read.
    To iterate is human, to recurse divine. -- L. Peter Deutsch
     
    #2
      Fredledingue

      • Total Posts : 572
      • Scores: 2
      • Reward points : 0
      • Joined: 5/9/2005
      • Location: Europe
      • Status: offline
      RE: innerHtml not working in Javascript Monday, April 27, 2009 5:58 AM (permalink)
      0
      Hi TNO,
       for your advices.

      "you"
      The quick answer is that you don't have a  name attribute on the tag you are trying to reference.

      Are you sure the reference is missing?
      It refers to
      <span id="MyPic">

      on line 105
      Furthermore if right after the line

      document.all.MyPic.innerHtml = '<img src="' + FileList[PicNum] + '" id="MyPicture">' ;

      I add

      alert(document.all.MyPic.innerHtml)

      it returns the new and accurate html. Proof that the span area has been modified but not updated in the browser window. Very strange since the same method works using vbs.
      I have debugged the script already in depth and clearly, it's the innerHtml method that messes it up.
      Anyway...just a few questions about what you said:

      Isn't it better to change this
      <img src="pic00" id="Pic0" height="100" OnClick="AddPrev(10)"
       onmouseover="document.body.style.cursor='hand'"

      by this
          <img src="pic00.jpg" id="Pic0" class="thumb" OnClick="AddPrev(10)"/>

      instead of
          <img src="pic00.jpg" id="Pic0" OnClick="AddPrev(10)"/>

      and use a s special class (thumb because they are thumbnails) in the css? Because img will influence the main image too.
      "you"
      You don't need the form tag, get rid of it.

      Yes, I used document.form.etc and I see that they are not needed if everything is defined by id's.
      Just a question about the id function: can I use id("MyPicture") directly as an object
      like:

      id("MyPicture").style.width = x

      or should I set a variable first, like this

      var objPic = id("MyPicture")
      objPic").style.width = x


      "you"
      replace window.onload with onload
      replace window.setInterval("DockToolBar()", 800); with setInterval(DockToolBar, 800);

      Can this "window" make any interference?
      "you"
      declare your variables or everything will be a global.

      I don't know if it's only me but... I prefer them to be global. (Unless of course you see a direct link with the innerHtml problem.)
      "you"
      replace your array

      ...to put everything on one line. Maybe. But for the moment the code is clearer in my eyes like this.
      "you"
      replace this PicNum = PicNum + i; with this: PicNum += i;

      Wow!:shock: coming from the normal world (vs. the javascript world) you will admit I didn't have the intuition to write it like that. But ok, I will do it. :P
      "you"
      Take all your event listeners out of the code and move them into the onload event:

      HoHo! I'm not sure I want to do that. For me it's much clearer the way I did, because I like to see in the html code what every element will do if I click on it.
      If I just see id= something it won't tell me much about the reaction upon mouse clicks.
      "you"
      ...rest of your code
      }

      You mean, the only good part in my code was this:
      }
      :D
      <message edited by Fredledingue on Monday, April 27, 2009 9:10 AM>
      Fred
       
      #3
        TNO

        • Total Posts : 2094
        • Scores: 36
        • Reward points : 0
        • Joined: 12/18/2004
        • Location: Earth
        • Status: offline
        RE: innerHtml not working in Javascript Monday, April 27, 2009 6:29 AM (permalink)
        0
        document.all.Foo

        This refers to Name attributes, not id's. VBS just can't (or won't) tell the difference even though they are not the same thing.

        Internet Explorer uses an outdated and non-standard method for accessing objects in the DOM.
        It tries to make it so every tag can be accessible as a property.  document.all.name1.name2.... the problem with this is that it allows you to get yourself in trouble by shadowing attributes.

        An example of where the name attribute can get you in trouble:

         <form action="myurl.asp" name="MyForm">
            <input type="hidden" name="action" value="UpdateStuff"/>
            <input type="submit"/>
         </form>


        What does MyForm.action refer to? See the problem? So its generally safer and standards compliant to use id instead



        id("MyPicture").style.width = x

        This is perfectly legal, just make sure you put  the measurement after x  ex:   x + "px"



        I didn't look at what your page rendered as honestly, so a class attribute may indeed be a better bet for your bottom images


        Can this "window" make any interference?

        Window is the Global object, so it's implied for setInterval and onload. It doesn't hurt to leave it in. I just think it's unnecessary to add the extra code



        I don't know if it's only me but... I prefer them to be global. (Unless of course you see a direct link with the innerHtml problem.)

        Declare them where you plan to use them otherwise you could run into problems later when you add more code and the values aren't coming out to what you expect them to be. The point is to avoid unforeseen side effects

        ...to put everything on one line. Maybe. But for the moment the code is clearer in my eyes like this.

        Fair enough, just showing you the alternative. You can also do this:

        var myList = [
           "Item0",
           "Item1",
           "Item2",
           "Item3",
           "Item4",
        ]



        Wow!:shock: coming from the normal world (vs. the javascript world) you will admit I didn't have the intuition to write it like that. But ok, I will do it. :P

        LOL, actually, this feature is available in most if not all C family languages + Python and Ruby.

        HoHo! I'm not sure I want to do that. For me it's much clearer the way I did, because I like to see in the html code what every element will do if I click on it.
        If I just see id= something it won't tell me much about the reaction upon mouse clicks.

        My argument here though is that you can separate your Presentation from your content from your Logic. This allows you to freely change any individual part without needing to touch the other parts. Such as changing the name of the function to fire and which element it fires on.
        On a small page such as this, you're right that it probably doesn't matter, but if/when you start to do multipage-applications or web sites you'll learn to prefer that method.
        To iterate is human, to recurse divine. -- L. Peter Deutsch
         
        #4
          Fredledingue

          • Total Posts : 572
          • Scores: 2
          • Reward points : 0
          • Joined: 5/9/2005
          • Location: Europe
          • Status: offline
          RE: innerHtml not working in Javascript Monday, April 27, 2009 10:02 AM (permalink)
          0

          This refers to Name attributes, not id's. VBS just can't (or won't) tell the difference even though they are not the same thing.

          I'v tried to use
          document.getElementById("MyPic").innerHtml = '<img src="' + FileList[PicNum] + '" id="MyPicture">' ;
            
           or
            
           objPic = document.getElementById("MyPic")
           objPic.innerHtml = '<img src="' + FileList[PicNum] + '" id="MyPicture">' ;
            
           also tried with
            
           <div>
           

          But it doesn't solve the problem :twisted:
          Perhaps it's a rare bug specific to my PC. I should try on other platforms.





          make sure you put the measurement after x  ex:   x + "px"

          On the vbs version, it was not necessary. But the value then returned (when requested) showed up with "px".





          I didn't look at what your page rendered as honestly, so a class attribute may indeed be a better bet for your bottom images

          This is a simple picture viewer. The image at the bottom are thumbnails.
          If you click on a thumnail, the picture should appear without the page being refreshed or opening another page.
          On the example the thumbnails are the same as the main pictures because I didn't bother doing thumbnails for my tests. You can test it yourself by using name or path of existing pictures in your computer.
          I favor using span instead of src because I plan to add some text with the picture and stuffs.
          There is also a floating toolabar with a zoom. The toolbar is replacing itself on top when the user scroll up or down.
          Both the zoom and the floating function are working.
          Only the main picture is not updating when clicking on the thumbnail. But if you do a test, you will see the border of the thumbnail changing ( indicating which picture is currently diplayed).
          This shos that other part of the script are working as intended.





          just showing you the alternative. You can also do this:

          As the pictures won't always be numbered or, even worse, not numbered as their array are, I like to see the array number in the code itself when testing. Of course in the future I can simplify the code the way you suggest.





          LOL, actually, this feature is available in most if not all C family languages + Python and Ruby.

          I always knew that it was easier to type javascript codes when you know C already...
          Fred
           
          #5
            TNO

            • Total Posts : 2094
            • Scores: 36
            • Reward points : 0
            • Joined: 12/18/2004
            • Location: Earth
            • Status: offline
            RE: innerHtml not working in Javascript Monday, April 27, 2009 10:10 AM (permalink)
            0
            Mind posting your updated code?
            To iterate is human, to recurse divine. -- L. Peter Deutsch
             
            #6
              Fredledingue

              • Total Posts : 572
              • Scores: 2
              • Reward points : 0
              • Joined: 5/9/2005
              • Location: Europe
              • Status: offline
              RE: innerHtml not working in Javascript Tuesday, April 28, 2009 9:55 AM (permalink)
              0
              Hi, TNO,
              This is the last version. I applied all your advices expect two, see below why.

              The problem persists. Tomorrow I'll try on another platforms to see if it's not my pc.
              If you want to try it, you just need six pics in the same folder and to replace the names of the pictures in the code.

               <html>
                 <head>
                     <title>Untitled Document</title>
                     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
               
                     <hta:application
                      id="PBrowser" 
                      applicationid="PicViewer"
                      navigable="yes"/>
               
                     <style type="text/css">
                     img.thumb{cursor:hand; height:100px;}
                     </style>
               
                <script language="JavaScript" type="text/javascript">
               
               onload = function() {
               objTool = document.all.ToolBar;
               objToolBar = objTool.style;
               iTimerID = setInterval("DockToolBar()", 800);
               PictureWidth = id("MyPicture").width;
               PictureHeight = id("MyPicture").height;
               OriginalPictureWidth = PictureWidth;
               OriginalPictureHeight = PictureHeight;
               FileList =[];
               FileList[0]='Pic0.jpg';
               FileList[1]='Pic1.jpg';
               FileList[2]='Pic2.jpg';
               FileList[3]='Pic3.jpg';
               FileList[4]='Pic4.jpg';
               FileList[5]='Pic5.jpg';
               PicCount=5;
               PicNum=0;
               }
               
               function DockToolBar() {
               var ScrlTop = document.body.scrollTop;
               if (ScrlTop > 0){
               objToolBar.top = 10 + ScrlTop;}
               else if ( objToolBar.top.replace("px", "")  !=10 ){
               objToolBar.top = 10;}
               }
               
               function Zoom(MyVar){
               switch(MyVar){
               case 1:
               PictureWidth = Math.round(PictureWidth * 1.2);
               PictureHeight = Math.round(PictureHeight * 1.2);
               break;
               case 2:
               PictureWidth = OriginalPictureWidth;
               PictureHeight = OriginalPictureHeight;
               break;
               case 3:
               PictureWidth = Math.round(PictureWidth / 1.2);
               PictureHeight = Math.round(PictureHeight / 1.2);
               break;
               case 4:
               PictureHeight = Math.round((document.body.clientHeight)*0.9);
               PictureWidth = OriginalPictureWidth/(OriginalPictureHeight/PictureHeight);
               }
               id("MyPicture").width = PictureWidth;
               id("MyPicture").height = PictureHeight;
               }
               
               function AddPrev(i){
               var objPic = id("Pic" + PicNum);
               objPic.border=0;
               if (i<10){
               PicNum += i;
                if (PicNum > PicCount){
                PicNum=PicCount;}
                else if (PicNum == -1){
                PicNum=0;}
               }
               else {
               PicNum=i-10;}
               
               if (PicNum==0){
               id("BtnNext").disabled = false;
               id("BtnPrev").disabled = true;
               }
               else if (PicNum == PicCount){
               id("BtnNext").disabled = true;
               id("BtnPrev").disabled = false;
               }
               else {
               id("BtnNext").disabled = false;
               id("BtnPrev").disabled = false;
               }
               objPic = id("MyPic")
               objPic.innerHtml = '<img src="' + FileList[PicNum] + '" id="MyPicture">' ;
               id("Pic" + PicNum).border=3;
               PictureWidth = id("MyPicture").width;
               PictureHeight = id("MyPicture").height;
               OriginalPictureWidth = PictureWidth;
               OriginalPictureHeight = PictureHeight;
               }
               
               function id(o){return document.getElementById(o)}
               
               </script>
               </head>
               <body>
               <p align="center"><br><br><span id="MyPic"><img src="Pic0.jpg" id="MyPicture"></span></p>
               <p id="ToolBar" align="justify"
               style="position: absolute; left: 5; top: 10; width: 640; height: 16; cursor='default'">
               <input id="BtnZoomIn" onclick="Zoom(1)" type="button" value="Zoom +">
               <input id="BtnZoomOut" onclick="Zoom(2)" type="button" value="100%">
               <input id="BtnZoomOut" onclick="Zoom(3)" type="button" value="Zoom -">
               <input id="BtnPrev" onclick="AddPrev(-1)" type="button" value="&#8592;">
               <input id="BtnNext" onclick="AddPrev(1)" type="button" value="&#8594;">
               </p>
               <p>
               <img src="Pic0.jpg" class="thumb" id="Pic0" onclick="AddPrev(10)">
               <img src="Pic1.jpg" class="thumb" id="Pic1" onclick="AddPrev(11)">
               <img src="Pic2.jpg" class="thumb" id="Pic2" onclick="AddPrev(12)">
               <img src="Pic3.jpg" class="thumb" id="Pic3" onclick="AddPrev(13)">
               <img src="Pic4.jpg" class="thumb" id="Pic4" onclick="AddPrev(14)">
               <img src="Pic5.jpg" class="thumb" id="Pic5" onclick="AddPrev(15)">
               </p>
               </body>
               </html>
               

              _______________

              this prevent the toolbar repositioning (see function DockToolBar() )

              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

              _______________

              replacing MyPicture.width with MyPicture.style.width and doing the same for the height attribute

              prevents the zoom to work. Probably because it needs the actual picture height and not the picture style's heigh.
              Picture.height is how many pixels high the picture is displayed on the browser.
              When the picture is diplayed on its original size, it calculates in effect the real height of this picture.
              Picture.style.height takes the height set by the style attribute.
              If this style attribute is not set, the value reutrned is null.
              What the function needs is the real height of the picture aka OriginalPictureHeight in my script.
              ______________
              I forgot to say that this code is for a website.  But I'm using hta for testing (html reacts exactly in the same way)
              <message edited by Fredledingue on Tuesday, April 28, 2009 10:12 AM>
              Fred
               
              #7
                TNO

                • Total Posts : 2094
                • Scores: 36
                • Reward points : 0
                • Joined: 12/18/2004
                • Location: Earth
                • Status: offline
                RE: innerHtml not working in Javascript Wednesday, April 29, 2009 9:38 AM (permalink)
                0
                Try this:

                (Tested in IE7+, FireFox 2+ Opera 9+, Chrome 2+, Safari 4b)

                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
                     <head>
                         <title>PicViewer</title>
                         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                         <style type="text/css">
                             img.thumb{
                                 cursor:pointer;
                                 height:100px;
                                 margin:.5em;
                             }
                             #ToolBar{
                                 position:fixed;
                                 left: 5px;
                                 top: 10px;
                                 width: 640px;
                                 height: 16px;
                                 cursor:default;
                             }
                         </style>
                 
                         <script type="text/javascript">
                             function id(o){return document.getElementById(o)}
                 
                             var selectedImage
                 
                             onload = function(){
                                 id("picList").firstChild.style.border = "3px solid black"
                                 selectedImage = id("picList").firstChild
                                 id("BtnPrev").disabled = true
                                 
                                 id("BtnZoomIn").onclick = function(){
                                     id("MyPicture").style.width = id("MyPicture").offsetWidth * 1.2 + "px"
                                 }
                                 id("BtnZoomNormal").onclick = function(){
                                     id("MyPicture").style.width = ""
                                 }
                                 id("BtnZoomOut").onclick = function(){
                                     id("MyPicture").style.width = id("MyPicture").offsetWidth * 0.8 + "px"
                                 }
                             }
                 
                             document.onclick = function(e,tg){
                                 e = e || window.event; //cross-browser event fix
                                 tg = tg || e.srcElement || e.target; //cross-browser target element
                                 if(tg.className == "thumb"){
                                     //reset all the image borders
                                     var img = tg.parentNode.getElementsByTagName("IMG")
                                     for (var i = 0; i < img.length; i++) {
                                         img[i].style.border = ""
                                     }
                                     tg.style.border = "3px solid black"
                                     selectedImage = tg
                                     
                                     //update the image source
                                     id("MyPicture").src = tg.src
                                     
                                     //disable|enable the button
                                     id("BtnNext").disabled = !Boolean(tg.nextSibling)
                                     id("BtnPrev").disabled = !Boolean(tg.previousSibling)
                                 }else{
                                     if(tg.id == "BtnNext" && !tg.disabled)
                                         document.onclick(null,selectedImage.nextSibling) //re-call the current function with the next element                        
                                     else if(tg.id == "BtnPrev" && !tg.disabled)
                                         document.onclick(null,selectedImage.previousSibling) //re-call the current function with the previous element                        
                                 }
                             }
                         </script>
                     </head>
                     <body>
                         <p style="text-align:center">
                             <br/><br/>
                             <img src="Pic0.jpg" id="MyPicture" alt=""/>
                         </p>
                         <p id="ToolBar">
                             <input id="BtnZoomIn" type="button" value="Zoom +" />
                             <input id="BtnZoomNormal" type="button" value="100%"/>
                             <input id="BtnZoomOut" type="button" value="Zoom -"/>
                             <input id="BtnPrev" type="button" value="&#8592;"/>
                             <input id="BtnNext" type="button" value="&#8594;"/>
                         </p>
                         <!-- The tags must remain on the same line for nextSibling/presiousSibling to work correctly cross-browser -->
                         <p id="picList"><img src="Pic0.jpg" class="thumb" alt=""/><img src="Pic1.jpg" class="thumb" alt=""/><img src="Pic2.jpg" class="thumb" alt=""/><img src="Pic3.jpg" class="thumb" alt=""/><img src="Pic4.jpg" class="thumb" alt=""/><img src="Pic5.jpg" class="thumb" alt=""/></p>
                     </body>
                 </html>
                 
                 

                To iterate is human, to recurse divine. -- L. Peter Deutsch
                 
                #8
                  Fredledingue

                  • Total Posts : 572
                  • Scores: 2
                  • Reward points : 0
                  • Joined: 5/9/2005
                  • Location: Europe
                  • Status: offline
                  RE: innerHtml not working in Javascript Wednesday, April 29, 2009 10:54 AM (permalink)
                  0
                  Completely buggy as far as I'm concerned. (IE 6+)
                  Have you tested or written this code yourself?

                  Edit: What does ||  means in javascript?
                   
                  Edit: Is it normal to have this: <br/> (and similar ends of tags)?
                  <message edited by Fredledingue on Wednesday, April 29, 2009 10:56 AM>
                  Fred
                   
                  #9
                    TNO

                    • Total Posts : 2094
                    • Scores: 36
                    • Reward points : 0
                    • Joined: 12/18/2004
                    • Location: Earth
                    • Status: offline
                    RE: innerHtml not working in Javascript Thursday, April 30, 2009 1:31 AM (permalink)
                    0
                    IE6? Ouch... a 9 year old browser.

                    This looks to work for me in IE6 (I just added a conditional comment for the floating bar)

                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                     <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
                        <head>
                            <title>PicViewer</title>
                            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                            <style type="text/css">
                                img.thumb{
                                    cursor:pointer;
                                    height:100px;
                                    margin:.5em;
                                }
                                #ToolBar{
                                    position:fixed;
                                    left: 5px;
                                    top: 10px;
                                    width: 640px;
                                    height: 16px;
                                    cursor:default;
                                }
                            </style>
                     
                             <!--[if lte IE 6]>
                             <style type="text/css">
                                 #ToolBar{
                                     position:absolute;
                                     top: expression( ( 10 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
                                 }
                             </style>
                             <![endif]-->
                     
                     
                            <script type="text/javascript">
                                function id(o){return document.getElementById(o)}
                     
                                var selectedImage
                     
                                onload = function(){
                                    id("picList").firstChild.style.border = "3px solid black"
                                    selectedImage = id("picList").firstChild
                                    id("BtnPrev").disabled = true
                                    
                                    id("BtnZoomIn").onclick = function(){
                                        id("MyPicture").style.width = id("MyPicture").offsetWidth * 1.2 + "px"
                                    }
                                    id("BtnZoomNormal").onclick = function(){
                                        id("MyPicture").style.width = ""
                                    }
                                    id("BtnZoomOut").onclick = function(){
                                        id("MyPicture").style.width = id("MyPicture").offsetWidth * 0.8 + "px"
                                    }
                                }
                     
                                document.onclick = function(e,tg){
                                    e = e || window.event; //cross-browser event fix
                                    tg = tg || e.srcElement || e.target; //cross-browser target element
                                    if(tg.className == "thumb"){
                                        //reset all the image borders
                                        var img = tg.parentNode.getElementsByTagName("IMG")
                                        for (var i = 0; i < img.length; i++) {
                                            img[i].style.border = ""
                                        }
                                        tg.style.border = "3px solid black"
                                        selectedImage = tg
                                        
                                        //update the image source
                                        id("MyPicture").src = tg.src
                                        
                                        //disable|enable the button
                                        id("BtnNext").disabled = !Boolean(tg.nextSibling)
                                        id("BtnPrev").disabled = !Boolean(tg.previousSibling)
                                    }else{
                                        if(tg.id == "BtnNext" && !tg.disabled)
                                            document.onclick(null,selectedImage.nextSibling) //re-call the current function with the next element                        
                                        else if(tg.id == "BtnPrev" && !tg.disabled)
                                            document.onclick(null,selectedImage.previousSibling) //re-call the current function with the previous element                        
                                    }
                                }
                            </script>
                        </head>
                        <body>
                            <p style="text-align:center">
                                <br/><br/>
                                <img src="Pic0.jpg" id="MyPicture" alt=""/>
                            </p>
                            <p id="ToolBar">
                                <input id="BtnZoomIn" type="button" value="Zoom +" />
                                <input id="BtnZoomNormal" type="button" value="100%"/>
                                <input id="BtnZoomOut" type="button" value="Zoom -"/>
                                <input id="BtnPrev" type="button" value="&#8592;"/>
                                <input id="BtnNext" type="button" value="&#8594;"/>
                            </p>
                            <!-- The tags must remain on the same line for nextSibling/presiousSibling to work correctly cross-browser -->
                            <p id="picList"><img src="Pic0.jpg" class="thumb" alt=""/><img src="Pic1.jpg" class="thumb" alt=""/><img src="Pic2.jpg" class="thumb" alt=""/><img src="Pic3.jpg" class="thumb" alt=""/><img src="Pic4.jpg" class="thumb" alt=""/><img src="Pic5.jpg" class="thumb" alt=""/></p>
                        </body>
                     </html>
                     


                    || is the OR operator in C-Syntax languages. In JavaScript though it can be used in a few other interesting ways. Everything in JavaScript has a natural boolean value associated to it, which makes comparison's trivial compared to most languages. :

                    tg = tg || e.srcElement || e.target

                    In this case I'm making tg equal to the first item on the right hand side that doesn't evaluate to false  (the first thing that is not null)

                    XHTML pages are XML compliant web pages. That being the case, all tags must be closed. <br/>, <img/> <meta/>....
                    To iterate is human, to recurse divine. -- L. Peter Deutsch
                     
                    #10
                      Fredledingue

                      • Total Posts : 572
                      • Scores: 2
                      • Reward points : 0
                      • Joined: 5/9/2005
                      • Location: Europe
                      • Status: offline
                      RE: innerHtml not working in Javascript Thursday, April 30, 2009 9:07 AM (permalink)
                      0
                      Hey! That works now!

                      IE6 doesn't support position:fixed; ?
                      But on IE7 it's much better: It stays there without flicking.

                      But there is still a small problem:
                      The thumbnail which are listed on this line:

                           <p id="picList"><img src="Pic0.jpg" class="thumb" alt=""/><img src="Pic1.jpg" ... etc

                      ...are not supposed to be the same files as the picture displayed in big.
                      So, what about something like that:

                             //update the image source
                              id("MyPicture").src =  tg.src.Replace( "_thumb", "")
                       
                      Because all the thumbnail bear the same name as the main picture + _thumb.

                      One more question: In Notepad++, these lines appear as comments:

                            <!--[if lte IE 6]>
                            <style type="text/css">
                                #ToolBar{
                                    position:absolute;
                                    top: expression( ( 10 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
                                }
                            </style>
                            <![endif]-->

                       
                      Is it normal?

                      I'm still puzzled about the innerHtml bug: I'v tried on three different computers, it never works.
                       
                      Thanks.


                      Fred
                       
                      #11
                        TNO

                        • Total Posts : 2094
                        • Scores: 36
                        • Reward points : 0
                        • Joined: 12/18/2004
                        • Location: Earth
                        • Status: offline
                        RE: innerHtml not working in Javascript Thursday, April 30, 2009 12:12 PM (permalink)
                        0
                        IE6 doesn't support position:fixed; ?

                        Here's a table showing the many things it doesn't support in comparison to other modern browsers:

                        http://www.quirksmode.org/css/contents.html
                        http://www.quirksmode.org/compatibility.html

                        ...Because all the thumbnail bear the same name as the main picture + _thumb.

                        Go for it, it should work.

                        One more question: In Notepad++, these lines appear as comments:
                        ...

                        Indeed. That is a Conditional Comment. Only Internet Explorer supports them. So every other browser will just see a comment and not try to run the code.
                        To iterate is human, to recurse divine. -- L. Peter Deutsch
                         
                        #12
                          Fredledingue

                          • Total Posts : 572
                          • Scores: 2
                          • Reward points : 0
                          • Joined: 5/9/2005
                          • Location: Europe
                          • Status: offline
                          RE: innerHtml not working in Javascript Sunday, May 03, 2009 8:53 AM (permalink)
                          0
                          Hi, TNO, just 2 or 3 questions before calling it final -maybe stupid but just to make sure- :
                           
                          1/ I merged some lines in the css, javascript and html codes. Won't that break the cross-browser compatibility?
                          (so far in IE6 it works)
                          I also plan to remove all comments and indents. The reason is that there will be many pages like that, automaticaly generated by a vbs (on my computer, before uploading to the website).
                           
                          2/ I added some direct links at the bottom of the page. This part is supposed to work without script.
                          I'm thinking here about those who want to download the pictures without passing each of them in the online-viewer, and possibly with their download manager etc.
                          And those who would have script disabled in their browsers.
                          Do you see anything to improve?
                           
                          3/ You will notice the &#0233;  symbol code. Are these fully cross-browser / cross-platform compatible?
                           
                          4/ What should be the extention of the file (htm, html, ... other)
                           
                          here is what I have:
                           
                           <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[link=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/link]">
                           <html xmlns="[link=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml[/link]" lang="en">
                             <head>
                                 <title>PicViewer</title>
                                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                                 <style type="text/css">
                                     img.thumb{cursor:pointer; height:100px; margin:.5em;}
                                     img.minithumb{height:40px;}
                                     #ToolBar{position:fixed; left: 5px; top: 10px; width: 640px; height: 16px; cursor:default;}
                                 </style>
                                  <!--[if lte IE 6]>
                                  <style type="text/css">
                                   #ToolBar{position:absolute; top: expression( ( 10 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); }   
                                  </style>
                                  <![endif]-->
                                 <script type="text/javascript">
                                     function id(o){return document.getElementById(o)}
                                     var selectedImage
                                     onload = function(){
                                         id("picList").firstChild.style.border = "3px solid black"
                                         selectedImage = id("picList").firstChild
                                         id("BtnPrev").disabled = true
                                         id("BtnZoomIn").onclick = function(){id("MyPicture").style.width = id("MyPicture").offsetWidth * 1.2 + "px"}
                                         id("BtnZoomNormal").onclick = function(){id("MyPicture").style.width = ""}
                                         id("BtnZoomOut").onclick = function(){id("MyPicture").style.width = id("MyPicture").offsetWidth * 0.8 + "px"}
                                     }
                                     document.onclick = function(e,tg){
                                         e = e || window.event; //cross-browser event fix
                                         tg = tg || e.srcElement || e.target; //cross-browser target element
                                         if(tg.className == "thumb"){
                                             //reset all the image borders
                                             var img = tg.parentNode.getElementsByTagName("IMG")
                                             for (var i = 0; i < img.length; i++) {img[i].style.border = ""}
                                             tg.style.border = "3px solid black"
                                             selectedImage = tg
                                             //update the image source
                                             id("MyPicture").src = tg.src.replace("_thumb", "")
                                             //disable|enable the button
                                             id("BtnNext").disabled = !Boolean(tg.nextSibling)
                                             id("BtnPrev").disabled = !Boolean(tg.previousSibling)
                                         }else{
                                             if(tg.id == "BtnNext" && !tg.disabled)document.onclick(null,selectedImage.nextSibling) //re-call the current function with the next element                        
                                             else if(tg.id == "BtnPrev" && !tg.disabled)document.onclick(null,selectedImage.previousSibling) //re-call the current function with the previous element                        
                                         }
                                     }
                                 </script>
                             </head>
                             <body>
                                 <p style="text-align:center"><br/><br/>
                                 <img src="Pic0.jpg" id="MyPicture" alt=""/>
                                 </p>
                                 <p id="ToolBar">
                                     <input id="BtnZoomIn" type="button" value="Zoom +" />
                                     <input id="BtnZoomNormal" type="button" value="100%"/>
                                     <input id="BtnZoomOut" type="button" value="Zoom -"/>
                                     <input id="BtnPrev" type="button" value="&#8592;"/>
                                     <input id="BtnNext" type="button" value="&#8594;"/>
                                 </p>
                                 <!-- The tags must remain on the same line for nextSibling/presiousSibling to work correctly cross-browser -->
                                 <p id="picList"><img src="Pic0_thumb.jpg" class="thumb" alt=""/><img src="Pic1_thumb.jpg" class="thumb" alt=""/><img src="Pic2_thumb.jpg" class="thumb" alt=""/><img src="Pic3_thumb.jpg" class="thumb" alt=""/><img src="Pic4_thumb.jpg" class="thumb" alt=""/><img src="Pic5_thumb.jpg" class="thumb" alt=""/></p>
                           <!-- Direct download and other direct links (No script) -->
                           <hr/>
                           <p style="text-align:center">
                           Back to / Retour vers: <a href="../fh.htm">List</a> | <a href="../index.htm">Homepage</a><br/><br/>
                           Direct Download / T&#0233;l&#0233;chargement direct:
                           </p><p>
                           <a href="Pic0.jpg">Pic0.jpg <img src="Pic0_thumb.jpg" class="minithumb"/></a> |
                           <a href="Pic1.jpg">Pic1.jpg <img src="Pic1_thumb.jpg" class="minithumb"/></a> |
                           <a href="Pic2.jpg">Pic2.jpg <img src="Pic2_thumb.jpg" class="minithumb"/></a> |
                           <a href="Pic3.jpg">Pic3.jpg <img src="Pic3_thumb.jpg" class="minithumb"/></a> |
                           <a href="Pic4.jpg">Pic4.jpg <img src="Pic4_thumb.jpg" class="minithumb"/></a> |
                           <a href="Pic5.jpg">Pic5.jpg <img src="Pic5_thumb.jpg" class="minithumb"/></a> |
                           </p>
                           </body>
                           </html>
                           

                          Fred
                           
                          #13
                            TNO

                            • Total Posts : 2094
                            • Scores: 36
                            • Reward points : 0
                            • Joined: 12/18/2004
                            • Location: Earth
                            • Status: offline
                            RE: innerHtml not working in Javascript Monday, May 04, 2009 2:57 AM (permalink)
                            0
                            #1: put some space between the parentheses and its following code for readability in your if/else expressions. but nothing syntactically wrong that I see

                            #2: All the cool stuff I can think of requires dropping support for IE6 I'm afraid.

                            #3: I haven't come across a problem with these yet.

                            #4: .html is fine. Windows 95 will interpret it as .htm, every other  browser and operating system should see the .html extension
                            To iterate is human, to recurse divine. -- L. Peter Deutsch
                             
                            #14
                              Fredledingue

                              • Total Posts : 572
                              • Scores: 2
                              • Reward points : 0
                              • Joined: 5/9/2005
                              • Location: Europe
                              • Status: offline
                              RE: innerHtml not working in Javascript Monday, May 04, 2009 10:51 AM (permalink)
                              0
                              Thanks.

                              Hey, I have found why innerHtml doesn't work: It should be written innerHTML.
                              Yet, innerText is written innerText.
                              hehehe
                              Goofy Javascript is case sensitive and good luck finding out where the upper cases should be, if any.

                              I have added some code to addd comments to the picture.
                              I didn't know how to get the thumbnail rank number among the node siblings, but I needed to find the pic number to fetch the corresponding comment from the array, so I did this:

                               for (var i = 0; i < img.length; i++) {
                                        img[i].style.border = ""
                                     if(tg.src == img[i].src)j=i
                                        }

                              Comments are contained in an array (see full code below).
                              j is the array number.

                              Also, you will notice that the event listener for closeComment() is in the html tag, not in your onload function.
                              If I put it in the onload function, the comment box closes immediately.
                              2d reason: There is also no effect anymore when the span is updated.

                              So like that it works and I think the concept is cool.
                              If you could check again for dangerous stuffs, here is the complete code:

                               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[link=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/link]">
                               <html xmlns="[link=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml[/link]" lang="en">
                               <head>
                                    <title>PicViewer</title>
                                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                                    <style type="text/css">
                                        img.thumb{cursor:pointer; height:100px; margin:.5em;}
                                        img.minithumb{height:40px;}
                                        #ToolBar{position:fixed; left: 5px; top: 10px; width: 640px; height: 64px; cursor:default;}
                                    </style>
                                     <!--[if lte IE 6]>
                                     <style type="text/css">
                                      #ToolBar{position:absolute; top: expression( ( 10 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); }   
                                    </style>
                                     <![endif]-->
                                    <script type="text/javascript">
                               MyComment =[]
                               MyComment[0]='This is <u>my comment</u> number <b>0</b>'
                               MyComment[1]='This is <u>my comment</u> number <b>1</b>'
                                 + '<br/>testing multiple lines!'
                                 + '<br/><br/><br/>like this.'
                               MyComment[2]='This is <u>my comment</u> number <b>2</b>'
                               MyComment[3]='This is <u>my comment</u> number <b>3</b>'
                               MyComment[4]='This is <u>my comment</u> number <b>4</b>'
                               MyComment[5]='This is <u>my comment</u> number <b>5</b>'
                               var tblop = '<table border="0"><tr><td width="240" bgcolor="#FFFFCC">'
                               var tblcl = '</td><td width="20" valign="top"><input id="BtnClose" type="button" value="X" onclick="closeComment()"/></td></tr></table>'
                                        function id(o){return document.getElementById(o)}
                                  function closeComment(){id("MyComment").innerHTML = ''}
                                        var selectedImage
                                        onload = function(){
                                            id("picList").firstChild.style.border = "3px solid black"
                                            selectedImage = id("picList").firstChild
                                            id("BtnPrev").disabled = true
                                            id("BtnZoomIn").onclick = function(){id("MyPicture").style.width = id("MyPicture").offsetWidth * 1.2 + "px"}
                                            id("BtnZoomNormal").onclick = function(){id("MyPicture").style.width = ""}
                                            id("BtnZoomOut").onclick = function(){id("MyPicture").style.width = id("MyPicture").offsetWidth * 0.8 + "px"}
                                        }
                                        document.onclick = function(e,tg){
                                            e = e || window.event; //cross-browser event fix
                                            tg = tg || e.srcElement || e.target; //cross-browser target element
                                            if(tg.className == "thumb"){
                                                //reset all the image borders
                                                var img = tg.parentNode.getElementsByTagName("IMG")
                                    var j = 0
                                                for (var i = 0; i < img.length; i++) {
                                        img[i].style.border = ""
                                     if(tg.src == img[i].src)j=i
                                        }
                                                tg.style.border = "3px solid black"
                                                selectedImage = tg
                                                //update the image source
                                                id("MyPicture").src = tg.src.replace("_thumb", "")
                                                id("MyComment").innerHTML = tblop + MyComment[j] + tblcl
                                                //disable|enable the button
                                                id("BtnNext").disabled = !Boolean(tg.nextSibling)
                                                id("BtnPrev").disabled = !Boolean(tg.previousSibling)
                                            }else{
                                                if(tg.id == "BtnNext" && !tg.disabled)document.onclick(null,selectedImage.nextSibling) //re-call the current function with the next element                        
                                                else if(tg.id == "BtnPrev" && !tg.disabled)document.onclick(null,selectedImage.previousSibling) //re-call the current function with the previous element                        
                                            }
                                        }
                                    </script>
                               </head>
                               <body>
                                    <p style="text-align:center"><br/><br/>
                                    <img src="Pic0.jpg" id="MyPicture" alt=""/>
                                    </p>
                                    <p id="ToolBar">
                                        <input id="BtnZoomIn" type="button" value="Zoom +" />
                                        <input id="BtnZoomNormal" type="button" value="100%"/>
                                        <input id="BtnZoomOut" type="button" value="Zoom -"/>
                                        <input id="BtnPrev" type="button" value="&#8592;"/>
                                        <input id="BtnNext" type="button" value="&#8594;"/><br/>
                                        <span id="MyComment">
                                        <table border="0">
                                          <tr>
                                            <td width="240" bgcolor="#FFFFCC">Test</td>
                                            <td width="20" valign="top"><input id="BtnClose" type="button" value="X" onclick="closeComment()"/></td>
                                          </tr>
                                        </table>
                                        </span>
                                    </p>
                                    <!-- The tags must remain on the same line for nextSibling/presiousSibling to work correctly cross-browser -->
                                    <p id="picList"><img src="Pic0_thumb.jpg" class="thumb" alt=""/><img src="Pic1_thumb.jpg" class="thumb" alt=""/><img src="Pic2_thumb.jpg" class="thumb" alt=""/><img src="Pic3_thumb.jpg" class="thumb" alt=""/><img src="Pic4_thumb.jpg" class="thumb" alt=""/><img src="Pic5_thumb.jpg" class="thumb" alt=""/></p>
                               <!-- Direct download and other direct links (No script) -->
                               <hr/>
                               <p style="text-align:center">
                               Back to / Retour vers: <a href="../fh.htm">List</a> | <a href="../index.htm">Homepage</a><br/><br/>
                               Direct Download / T&#0233;l&#0233;chargement direct:
                               </p><p>
                               <a href="Pic0.jpg" target="_blank">Pic0.jpg <img src="Pic0_thumb.jpg" class="minithumb"/></a> |
                               <a href="Pic1.jpg" target="_blank">Pic1.jpg <img src="Pic1_thumb.jpg" class="minithumb"/></a> |
                               <a href="Pic2.jpg" target="_blank">Pic2.jpg <img src="Pic2_thumb.jpg" class="minithumb"/></a> |
                               <a href="Pic3.jpg" target="_blank">Pic3.jpg <img src="Pic3_thumb.jpg" class="minithumb"/></a> |
                               <a href="Pic4.jpg" target="_blank">Pic4.jpg <img src="Pic4_thumb.jpg" class="minithumb"/></a> |
                               <a href="Pic5.jpg" target="_blank">Pic5.jpg <img src="Pic5_thumb.jpg" class="minithumb"/></a> |
                               </p>
                               </body>
                               </html>
                               


                              #2: All the cool stuff I can think of requires dropping support for IE6 I'm afraid.

                              Plain html is cool enough for me. LOL!
                              Added target="_blank" thought to open in a new window. Requiring the user to go back at every pic is silly.
                              <message edited by Fredledingue on Monday, May 04, 2009 10:56 AM>
                              Fred
                               
                              #15
                                TNO

                                • Total Posts : 2094
                                • Scores: 36
                                • Reward points : 0
                                • Joined: 12/18/2004
                                • Location: Earth
                                • Status: offline
                                RE: innerHtml not working in Javascript Wednesday, May 06, 2009 1:04 AM (permalink)
                                0
                                Goofy Javascript is case sensitive and good luck finding out where the upper cases should be, if any.

                                JavaScript follows the SmallTalk precedent of naming conventions for methods. THe first letter of every word is uppercase, not including the first letter unless it is a Constructor (similar to a Class).

                                innerHTML, innerText, and other DOM methods are not part of the JavaScript language so are not to blame. Blame the W3C for naming the browser API that way.

                                 if(tg.src == img.src)j=i

                                you should add at least a space for readability if you insist on keeping it on the same line:

                                 if(tg.src == img.src) j=i;


                                Added target="_blank" thought to open in a new window. Requiring the user to go back at every pic is silly.

                                You should probably replace that with window.open for me at least it takes like 10 seconds for my browser to fire up, I assume most people will be even slower than that

                                My Computer:

                                2GB RAM
                                2.21 GHz AMD Phenom 9500 Quad Code



                                Also, you will notice that the event listener for closeComment() is in the html tag, not in your onload function.
                                If I put it in the onload function, the comment box closes immediately.
                                2d reason: There is also no effect anymore when the span is updated.


                                I didn't look too deeply but I suspect your overwriting the button and destroying the attached event.
                                <message edited by TNO on Wednesday, May 06, 2009 9:56 AM>
                                To iterate is human, to recurse divine. -- L. Peter Deutsch
                                 
                                #16
                                  Fredledingue

                                  • Total Posts : 572
                                  • Scores: 2
                                  • Reward points : 0
                                  • Joined: 5/9/2005
                                  • Location: Europe
                                  • Status: offline
                                  RE: innerHtml not working in Javascript Wednesday, May 06, 2009 9:35 AM (permalink)
                                  0
                                  You should probably replace that with window.open
                                   
                                  Geez, how many things do I still have to learn?
                                   
                                  I never noticed that it caused a delay. Maybe one second or so on my PC. Now that I tried window.open it's instantly.
                                  However using a script in a link (href="javascript: etc) cause my browser to take ages or not responding until I lose my patience.
                                  But many poeple do that.
                                  It's amazing how many bad code we can find in on line tutorials. No way I could have found what you wrote for me.
                                   
                                  the JavaScript language so are not to blame. BLame the W3C
                                   
                                  Whoever is to blame, the most important is to know.
                                   
                                  I didn't look too deeply but I suspect your orverwriting the button and destroying the attached event.
                                   
                                  Yes. I overwrite the button because I want it to disapear with the text. I want as less as possible over the picture.
                                  I also used a trick to get the box + the cloce button the same width as the toolbar:
                                  id("TableSpan").style.width = id("TableBtn").offsetWidth
                                   
                                  I had to include the toolbar in a table too, just to get its width and set id's.
                                  Here is the last version with this modification:
                                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[link=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/link]">
                                   <html xmlns="[link=http://www.w3.org/1999/xhtml]http://www.w3.org/1999/xhtml[/link]" lang="en">
                                     <head>
                                         <title>PicViewer</title>
                                         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                                         <style type="text/css">
                                             img.thumb{cursor:pointer; height:100px; margin:.5em;}
                                             img.minithumb{height:40px;}
                                             #ToolBar{position:fixed; left: 5px; top: 10px; width: 640px; height: 64px; cursor:default;}
                                         </style>
                                          <!--[if lte IE 6]>
                                          <style type="text/css">
                                           #ToolBar{position:absolute; top: expression( ( 10 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); }   
                                         </style>
                                          <![endif]-->
                                         <script type="text/javascript">
                                   MyComment =[]
                                   MyComment[0]='This is <u>my comment</u> number <b>0</b>'
                                   MyComment[1]='This is <u>my comment</u> number <b>1</b>'
                                      + '<br/>testing multiple lines!'
                                      + '<br/><br/><br/>like this.'
                                   MyComment[2]='This is <u>my comment</u> number <b>2</b>'
                                   MyComment[3]='This is <u>my comment</u> number <b>3</b>'
                                   MyComment[4]='This is <u>my comment</u> number <b>4</b>'
                                   MyComment[5]='This is <u>my comment</u> number <b>5</b>'
                                   var tblop = '<table border="0" id="TableSpan"><tr><td bgcolor="#FFFFCC">'
                                   var tblcl = '</td><td width="10%" valign="top" align="right"><input id="BtnClose" type="button" value="X" onclick="closeComment()"/></td></tr></table>'
                                             function id(o) {return document.getElementById(o)}
                                       function closeComment() {id("MyComment").innerHTML = ''}
                                             var selectedImage
                                             onload = function() {
                                           id("TableSpan").style.width = id("TableBtn").offsetWidth
                                                 id("picList").firstChild.style.border = "3px solid black"
                                                 selectedImage = id("picList").firstChild
                                                 id("BtnPrev").disabled = true
                                                 id("BtnZoomIn").onclick = function() {id("MyPicture").style.width = id("MyPicture").offsetWidth * 1.2 + "px"}
                                                 id("BtnZoomNormal").onclick = function() {id("MyPicture").style.width = ""}
                                                 id("BtnZoomOut").onclick = function() {id("MyPicture").style.width = id("MyPicture").offsetWidth * 0.8 + "px"}
                                             }
                                             document.onclick = function(e,tg){
                                                 e = e || window.event; //cross-browser event fix
                                                 tg = tg || e.srcElement || e.target; //cross-browser target element
                                                 if(tg.className == "thumb"){
                                                     //reset all the image borders
                                                     var img = tg.parentNode.getElementsByTagName("IMG")
                                         var j = 0
                                                     for (var i = 0; i < img.length; i++) {
                                             img[i].style.border = ""
                                          if(tg.src == img[i].src) j=i
                                             }
                                                     tg.style.border = "3px solid black"
                                                     selectedImage = tg
                                                     //update the image source
                                                     id("MyPicture").src = tg.src.replace("_thumb", "")
                                                     id("MyComment").innerHTML = tblop + MyComment[j] + tblcl
                                         //adjust comment box width to line up with the toolbar
                                         id("TableSpan").style.width = id("TableBtn").offsetWidth
                                                     //disable|enable the button
                                                     id("BtnNext").disabled = !Boolean(tg.nextSibling)
                                                     id("BtnPrev").disabled = !Boolean(tg.previousSibling)
                                                 }else{
                                                     if(tg.id == "BtnNext" && !tg.disabled)document.onclick(null,selectedImage.nextSibling) //re-call the current function with the next element                        
                                                     else if(tg.id == "BtnPrev" && !tg.disabled)document.onclick(null,selectedImage.previousSibling) //re-call the current function with the previous element                        
                                                 }
                                             }
                                         </script>
                                     </head>
                                     <body>
                                         <p style="text-align:center"><br/><br/>
                                         <img src="Pic0.jpg" id="MyPicture" alt=""/>
                                         </p>
                                         <p id="ToolBar">
                                         <table border="0" id="TableBtn">
                                        <tr><td>
                                               <input id="BtnZoomIn" type="button" value="Zoom +" />
                                               <input id="BtnZoomNormal" type="button" value="100%"/>
                                               <input id="BtnZoomOut" type="button" value="Zoom -"/>
                                               <input id="BtnPrev" type="button" value="&#8592;"/>
                                               <input id="BtnNext" type="button" value="&#8594;"/><br/>
                                              </td></tr>
                                         </table>
                                            <span id="MyComment">
                                            <table border="0" id="TableSpan">
                                               <tr>
                                                 <td bgcolor="#FFFFCC">Test</td>
                                                 <td valign="top" align="right" width="10%"><input id="BtnClose" type="button" value="X" onclick="closeComment()"/></td>
                                               </tr>
                                             </table>
                                             </span>
                                         </p>
                                         <!-- The tags must remain on the same line for nextSibling/presiousSibling to work correctly cross-browser -->
                                         <p id="picList"><img src="Pic0_thumb.jpg" class="thumb" alt=""/><img src="Pic1_thumb.jpg" class="thumb" alt=""/><img src="Pic2_thumb.jpg" class="thumb" alt=""/><img src="Pic3_thumb.jpg" class="thumb" alt=""/><img src="Pic4_thumb.jpg" class="thumb" alt=""/><img src="Pic5_thumb.jpg" class="thumb" alt=""/></p>
                                   <!-- Direct download and other direct links (No script) -->
                                   <hr/>
                                   <p style="text-align:center">
                                   Back to / Retour vers: <a href="../fh.htm">List</a> | <a href="../index.htm">Homepage</a><br/><br/>
                                   Direct Download / T&#0233;l&#0233;chargement direct:
                                   </p><p>
                                   <a href="Pic0.jpg" target="window.open">Pic0.jpg <img src="Pic0_thumb.jpg" class="minithumb"/></a> |
                                   <a href="Pic1.jpg" target="window.open">Pic1.jpg <img src="Pic1_thumb.jpg" class="minithumb"/></a> |
                                   <a href="Pic2.jpg" target="window.open">Pic2.jpg <img src="Pic2_thumb.jpg" class="minithumb"/></a> |
                                   <a href="Pic3.jpg" target="window.open">Pic3.jpg <img src="Pic3_thumb.jpg" class="minithumb"/></a> |
                                   <a href="Pic4.jpg" target="window.open">Pic4.jpg <img src="Pic4_thumb.jpg" class="minithumb"/></a> |
                                   <a href="Pic5.jpg" target="window.open">Pic5.jpg <img src="Pic5_thumb.jpg" class="minithumb"/></a> |
                                   </p>
                                   </body>
                                   </html>
                                   
                                   

                                  Fred
                                   
                                  #17
                                    TNO

                                    • Total Posts : 2094
                                    • Scores: 36
                                    • Reward points : 0
                                    • Joined: 12/18/2004
                                    • Location: Earth
                                    • Status: offline
                                    RE: innerHtml not working in Javascript Tuesday, May 12, 2009 4:02 AM (permalink)
                                    0
                                    Yes. I overwrite the button because I want it to disapear with the text. I want as less as possible over the picture.

                                    Why don't you just update the display property then? I think that should fix the event as well.


                                    id("BtnClose").onclick = function(){
                                       this.style.display = "none"
                                    }


                                    and then when you need to show it later:

                                    .style.display = "block" //or inline, whatever you prefer


                                    However using a script in a link (href="javascript: etc) cause my browser to take ages or not responding until I lose my patience.
                                    But many poeple do that.

                                    The people who do that are oftentimes trying to avoid adding an onclick event to their tag. Generally you would want to do something like this instead with a link:

                                    id("blah").onclick = function(){
                                       //stuff
                                      return false; //cancel the event that normally occurs on a link
                                    }

                                    ...

                                    <a id="blah" href="#">Fake Link</a>
                                    <message edited by TNO on Tuesday, May 26, 2009 3:16 AM>
                                    To iterate is human, to recurse divine. -- L. Peter Deutsch
                                     
                                    #18
                                      Fredledingue

                                      • Total Posts : 572
                                      • Scores: 2
                                      • Reward points : 0
                                      • Joined: 5/9/2005
                                      • Location: Europe
                                      • Status: offline
                                      RE: innerHtml not working in Javascript Sunday, June 14, 2009 10:52 PM (permalink)
                                      0
                                      Hi TNO!
                                       
                                      I'v been away for one month. Now I'm back and I applied what you said.
                                      + I dynamicaly change the background color of the table (yellow/transparent) because I noticed a thin yellow line remains if I only erase the content.
                                       
                                      The new lines in the script are
                                       
                                      id("BtnClose").onclick = function() {this.style.display = "none"; id("MyComment").innerHTML =''; id("TableSpan").bgColor =''}
                                       
                                      and
                                       
                                      //update comment box and adjust its width to line up with the toolbar
                                      id("MyComment").innerHTML = MyComment[j]
                                      id("BtnClose").style.display = "inline"
                                      id("TableSpan").style.width = id("TableBtn").offsetWidth
                                      id("TableSpan").bgColor="#FFFFCC"

                                       
                                      and in the html body:
                                       
                                      <table bgcolor="#FFFFCC" border="0" id="TableSpan">
                                                  <tr>
                                                    <td><span id="MyComment">Test</span></td>
                                                    <td valign="top" align="right" width="10%"><input id="BtnClose" type="button" value="X"/></td>
                                                  </tr>
                                      </table>

                                       
                                      full source:
                                       
                                       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                       <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
                                         <head>
                                             <title>PicViewer</title>
                                             <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                                             <style type="text/css">
                                                 img.thumb{cursor:pointer; height:100px; margin:.5em;}
                                                 img.minithumb{height:40px;}
                                                 #ToolBar{position:fixed; left: 5px; top: 10px; width: 640px; height: 64px; cursor:default;}
                                             </style>
                                              <!--[if lte IE 6]>
                                              <style type="text/css">
                                               #ToolBar{position:absolute; top: expression( ( 10 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); }   
                                             </style>
                                              <![endif]-->
                                             <script type="text/javascript">
                                       MyComment =[]
                                       MyComment[0]='This is <u>my comment</u> number <b>0</b>'
                                       MyComment[1]='This is <u>my comment</u> number <b>1</b>'
                                          + '<hr>testing multiple lines!'
                                          + '<br/><br/><br/>like this.'
                                       MyComment[2]='This is <u>my comment</u> number <b>2</b>'
                                       MyComment[3]='This is <u>my comment</u> number <b>3</b>'
                                       MyComment[4]='This is <u>my comment</u> number <b>4</b>'
                                       MyComment[5]='This is <u>my comment</u> number <b>5</b>'
                                                 function id(o) {return document.getElementById(o)}
                                                 var selectedImage
                                           
                                                 onload = function() {
                                               id("TableSpan").style.width = id("TableBtn").offsetWidth
                                                     id("picList").firstChild.style.border = "3px solid black"
                                                     selectedImage = id("picList").firstChild
                                                     id("BtnPrev").disabled = true
                                                     id("BtnZoomIn").onclick = function() {id("MyPicture").style.width = id("MyPicture").offsetWidth * 1.2 + "px"}
                                                     id("BtnZoomNormal").onclick = function() {id("MyPicture").style.width = ""}
                                                     id("BtnZoomOut").onclick = function() {id("MyPicture").style.width = id("MyPicture").offsetWidth * 0.8 + "px"}
                                            id("BtnClose").onclick = function() {this.style.display = "none"; id("MyComment").innerHTML =''; id("TableSpan").bgColor =''}
                                                 }
                                           
                                                 document.onclick = function(e,tg) {
                                                     e = e || window.event; //cross-browser event fix
                                                     tg = tg || e.srcElement || e.target; //cross-browser target element
                                                     if(tg.className == "thumb") {
                                                         //reset all the image borders
                                                         var img = tg.parentNode.getElementsByTagName("IMG")
                                             var j = 0
                                                         for (var i = 0; i < img.length; i++) {
                                                 img[i].style.border = ""
                                              if(tg.src == img[i].src) j=i
                                                 }
                                                         tg.style.border = "3px solid black"
                                                         selectedImage = tg
                                                         //update the image source
                                                         id("MyPicture").src = tg.src.replace("_thumb", "")
                                             //update comment box and adjust its width to line up with the toolbar
                                                         id("MyComment").innerHTML = MyComment[j]
                                             id("BtnClose").style.display = "inline"
                                             id("TableSpan").style.width = id("TableBtn").offsetWidth
                                             id("TableSpan").bgColor="#FFFFCC"
                                                         //disable|enable the button
                                                         id("BtnNext").disabled = !Boolean(tg.nextSibling)
                                                         id("BtnPrev").disabled = !Boolean(tg.previousSibling)
                                                     }else{
                                                         if(tg.id == "BtnNext" && !tg.disabled)document.onclick(null,selectedImage.nextSibling) //re-call the current function with the next element                        
                                                         else if(tg.id == "BtnPrev" && !tg.disabled)document.onclick(null,selectedImage.previousSibling) //re-call the current function with the previous element
                                                     }
                                                 }
                                         </script>
                                         </head>
                                         <body>
                                             <p style="text-align:center"><br/><br/>
                                             <img src="Pic0.jpg" id="MyPicture" alt=""/>
                                             </p>
                                             <p id="ToolBar">
                                             <table border="0" id="TableBtn">
                                            <tr><td>
                                                   <input id="BtnZoomIn" type="button" value="Zoom +" />
                                                   <input id="BtnZoomNormal" type="button" value="100%"/>
                                                   <input id="BtnZoomOut" type="button" value="Zoom -"/>
                                                   <input id="BtnPrev" type="button" value="&#8592;"/>
                                                   <input id="BtnNext" type="button" value="&#8594;"/><br/>
                                                  </td></tr>
                                             </table>
                                                <table bgcolor="#FFFFCC" border="0" id="TableSpan">
                                                   <tr>
                                                     <td><span id="MyComment">Test</span></td>
                                                     <td valign="top" align="right" width="10%"><input id="BtnClose" type="button" value="X"/></td>
                                                   </tr>
                                                 </table>
                                             </p>
                                             <!-- The tags must remain on the same line for nextSibling/presiousSibling to work correctly cross-browser -->
                                             <p id="picList"><img src="Pic0_thumb.jpg" class="thumb" alt=""/><img src="Pic1_thumb.jpg" class="thumb" alt=""/><img src="Pic2_thumb.jpg" class="thumb" alt=""/><img src="Pic3_thumb.jpg" class="thumb" alt=""/><img src="Pic4_thumb.jpg" class="thumb" alt=""/><img src="Pic5_thumb.jpg" class="thumb" alt=""/></p>
                                       <!-- Direct download and other direct links (No script) -->
                                       <hr/>
                                       <p style="text-align:center">
                                       Back to / Retour vers: <a href="../fh.htm">List</a> | <a href="../index.htm">Homepage</a><br/><br/>
                                       Direct Download / T&#0233;l&#0233;chargement direct:
                                       </p><p>
                                       <a href="Pic0.jpg" target="window.open">Pic0.jpg <img src="Pic0_thumb.jpg" class="minithumb"/></a> |
                                       <a href="Pic1.jpg" target="window.open">Pic1.jpg <img src="Pic1_thumb.jpg" class="minithumb"/></a> |
                                       <a href="Pic2.jpg" target="window.open">Pic2.jpg <img src="Pic2_thumb.jpg" class="minithumb"/></a> |
                                       <a href="Pic3.jpg" target="window.open">Pic3.jpg <img src="Pic3_thumb.jpg" class="minithumb"/></a> |
                                       <a href="Pic4.jpg" target="window.open">Pic4.jpg <img src="Pic4_thumb.jpg" class="minithumb"/></a> |
                                       <a href="Pic5.jpg" target="window.open">Pic5.jpg <img src="Pic5_thumb.jpg" class="minithumb"/></a> |
                                       </p>
                                       </body>
                                       </html>
                                       
                                       

                                      Fred
                                       
                                      #19
                                        TNO

                                        • Total Posts : 2094
                                        • Scores: 36
                                        • Reward points : 0
                                        • Joined: 12/18/2004
                                        • Location: Earth
                                        • Status: offline
                                        RE: innerHtml not working in Javascript Monday, June 15, 2009 2:23 AM (permalink)
                                        0
                                        So its all good now?
                                        To iterate is human, to recurse divine. -- L. Peter Deutsch
                                         
                                        #20

                                          Online Bookmarks Sharing: Share/Bookmark
                                          Change Page: 12 > | Showing page 1 of 2, messages 1 to 20 of 21

                                          Jump to:

                                          Current active users

                                          There are 0 members and 1 guests.

                                          Icon Legend and Permission

                                          • New Messages
                                          • No New Messages
                                          • Hot Topic w/ New Messages
                                          • Hot Topic w/o New Messages
                                          • Locked w/ New Messages
                                          • Locked w/o New Messages
                                          • Read Message
                                          • Post New Thread
                                          • Reply to message
                                          • Post New Poll
                                          • Submit Vote
                                          • Post reward post
                                          • Delete my own posts
                                          • Delete my own threads
                                          • Rate post

                                          2000-2012 ASPPlayground.NET Forum Version 3.9