Javascript Object Found,但该方法不适用于该对象

时间:2014-05-05 07:32:35

标签: javascript ajax prototypejs

我在页面加载时通过ajax加载打击内容。此外,我有按钮选项,以便在单击时通过ajax加载此内容。我的问题是,当点击标签来激活showSubcourse()方法来显示时,它没有显示出来。请提前感谢解决方案。

<div>
   <div style="vertical-align: middle;">
     <a href="javascript:void(0)" onclick="showSubcourse(265);" class="algemene">
      <img src="../verwaltung/uploads/Bewust_image1.png" alt="">
     </a>
    <a href="javascript:void(0)" onclick="showSubcourse(265);">
       <span>
       course 1
     </span>
    </a>
  </div>
  <div id="coursepopup-265" class="Bewustwordenpopupboxouter" style="display: none;">
    <div class="Bewustwordenpopupbox">
     <a href="javascript:closePopup()">
        Close
     </a>
     <div>
       <div style="text-align: center; display: inline-block; width: 186px; height: 22px; padding-top: 5px; margin: 7px 0px;">
       <span style="font-size: 100%; vertical-align: middle;">
        alcohol
      </span>
      <span onclick="MyDesktop.openGadgetGroup( $A([           $H({gadget_name: 'onlinecoachingpath', left : 5, top : 10, width : 770, new_coaching_string_id: 33, init_strategy_id: ''})           ]) ); event.stop();" class="ap-blue clickable" style="">
        <img style="height: 24px;" src="images/p_redo_blue.png">
      </span>

    </div>
  </div>
  <div>
    <div style="text-align: center; display: inline-block; width: 186px; height: 22px; padding-top: 5px; margin: 7px 0px;">
      <span style="font-size: 100%; vertical-align: middle;">
        bewegen
      </span>
      <span onclick="MyDesktop.openGadgetGroup( $A([           $H({gadget_name: 'onlinecoachingpath', left : 5, top : 10, width : 770, new_coaching_string_id: 31, init_strategy_id: ''})           ]) ); event.stop();" class="ap-blue clickable" style="">
        <img style="height: 24px;" src="images/p_redo_blue.png">
      </span>

    </div>
   </div>
   </div>
  </div>
 </div>

这是我的js代码,它是单独的文件,它包含在页面加载,使用原型js来显示和隐藏div。     

function showSubcourse(id) {
    $("coursepopup-" + id).show();
}

function closePopup() {
    $("div.Bewustwordenpopupboxouter").each(Element.hide);
}
</script>

0 个答案:

没有答案