Jquery函数无法处理警报 [英] Jquery function not working with out alert

查看:109
本文介绍了Jquery函数无法处理警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的期待

你好我在drupal 7中使用了以下代码,如果我把警报放在函数中它工作正常。但是我删除了它不工作的警报请给我一些建议







Dear Expects
Hi I used the following code in drupal 7 if i put the alert within the function its works fine. but i removed the alert it is not working please give me some suggestions



jQuery( document ).ready(function()
{

   jQuery("a.fieldset-title").click(function()
   {

      alert('h');

      var getids=jQuery(this).closest('fieldset').attr('id');
      //var val = jQuery(getids).val();
      var getidsvv=jQuery(this).closest('span').attr('class');

      var val2 = jQuery(this).find("span.fieldset-legend-prefix").text();

      if(getids =='node_template_form_group_screen1fields')
      {
         var values1=jQuery("#node_template_form_group_screen1fields span").eq(1).text();

         if(values1 =='Hide')
         {
            document.getElementById('screen1_main').style.display="block";
         }

         if(values1 =='Show')
         {
            document.getElementById('screen1_main').style.display="none";
         }
      }
   }); 
});





添加了代码块和缩进



Code block and indentation added

推荐答案

这篇关于Jquery函数无法处理警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆