0

I have built a page which loads data dynamiically from a DB and uses jQuery to add html labels and classes to the page

the html is

    <fieldset>
        <legend>msgs</legend>
            <div id="maya">
                <!--Here will come the maya msgs-->
            </div>
    </fieldset>
<fieldset>
    <legend>recommendation</legend>

    <div id="recommendText"></div>

    <div id="rate" class="rating">
        <div id="star1"></div>
        <div id="star2"></div>
        <div id="star3"></div>
        <div id="star4"></div>
        <div id="star5"></div>
    </div>
</fieldset>

and the js is

 date = '<label id="tbDate" for="tbMessage" class="label_info">'+data[i++]+'</label>';
            link = '<label id="tbMessage" class="label_info_text" ><a href="'+data[i++]+'" target="_blank">'+data[i++]+'</label>';

      $("#maya").append('<div class="label_maya_info">'+date+link+'</div>'+clear);
      $('#stars1').addClass("star");
     $('#stars2').addClass("halfStar");

it works on FF and chrome but not IE8.

the page link is http://www.s-maof.com/PRO/index.php?fkapp=9 (look for '649012' in the search box - there is only one).

Also the high charts graph doesn't work (only on IE).

thanks.

devmonster
  • 1,729
  • 8
  • 24
  • 48
  • In this line: $("#maya").append('
    '+date+link+'
    '+clear); you have a reference to "clear"...what is that? I don't see it defined in your script. Do you get any errors in IE?
    – Michael Giovanni Pumo Jul 16 '12 at 15:29
  • Questions in general should contain a question! This is a sentence where you ask something, ending with an `?`! Also, "It does not work" is no proper problem description. Please improve your question, or you won't get any valid answers (not to mention that most people won't be able to read hebrew - which does not make the task to help easier...) – Christoph Jul 16 '12 at 15:38
  • michael, errors in IE ? how do I see those? I know the F12 window but I can't see any javacode debuging there.. – devmonster Jul 16 '12 at 17:35

1 Answers1

0

thanks guys, i figured this out. The problem wasn't with jquery. It was with the syntax :

link = '<label id="tbMessage" class="label_info_text" ><a href="'+data[i++]+'" target="_blank">'+data[i++]+'</a></label>';  //added closing </a>

The addClass didn't work because I didn't "css" those element correctly.

devmonster
  • 1,729
  • 8
  • 24
  • 48