Используйте jQuery для изменения значения метки

У меня есть ярлык costLabel.

Я хочу иметь возможность изменять значение этой метки в зависимости от выбранного значения в раскрывающемся списке.

Это мой HTML:

<table>
  <tr>
    <td width="343">Package*</td>

    <td colspan="4">
      <select class="purple" name="package">
        <option value="standard">Standard - &euro;55 Monthly</option>
        <option value="standardAnn">Standard - &euro;49 Monthly</option>            
        <option value="premium">Premium - &euro;99 Monthly</option>
        <option value="premiumAnn" selected="selected">Premium - &euro;89 Monthly</option>            
        <option value="platinum">Platinum - &euro;149 Monthly</option>
        <option value="platinumAnn">Platinum - &euro;134 Monthly</option>            
      </select>
    </td>

  <tr>
    <td width="343">
      <p>We bills quarterly/annually in advance</p>
      <p>See <a href="#dialog" name="modal">Pricing</a> for more details</p>
    </td>
    <td colspan="4"><label id="costlabel" name="costlabel">Total Cost:</label></td>

  <tr>
</table>

Значения, которые входят в метку стоимости, следующие:

  • Standard = «165 евро в квартал»
  • StandardAnn = «588 евро в год»
  • Premium = «297 евро в квартал»
  • PremiumAnn = «1068 евро в год»
  • Platinum = «447 евро в квартал»
  • PlatinumAnn = " возникает ли проблема, когда поток ставит в очередь int, а другой поток выводит из очереди int одновременно? Должен ли я блокировать операции Enqueue и Dequeue для обеспечения безопасности потоков?

    class Test {
        public static Queue<int> queue = new Queue<int>(10000);
    
        Thread putIntThread;
        Thread takeIntThread;
    
        public Test() {
            for(int i = 0; i < 5000; ++i) {
                queue.Enqueue(0);
            }
            putIntThread = new Thread(this.PutInt);
            takeIntThread = new Thread(this.TakeInt);
            putIntThread.Start();
            takeIntThread.Start();
        }
    
        void PutInt() {
            while(true)
            {
                if(queue.Count < 10000) {//no need to lock here as only itself can change this condition
                    queue.Enqueue(0);
                }
            }
        }
    
        void TakeInt() {
            while(true) {
                if(queue.Count > 0) {//no need to lock here as only itself can change this condition
                    queue.Dequeue();
                }
            }
        }
    
    }
    

    Изменить: я должен использовать .NET 3.5

9
задан blizpasta 6 October 2010 в 08:38
поделиться