【问题标题】:ckFinder - simulate refresh click using jQueryckFinder - 使用 jQuery 模拟刷新点击
【发布时间】:2012-09-17 18:26:58
【问题描述】:

我试图让 jQuery 在加载选项卡时模拟单击 ckFinder 的刷新按钮。无论我使用什么代码,点击都不会注册/提醒。使用 Firebug,我抓取了刷新按钮源:

    <a onclick="window.parent.CKFinder._.callFunction(3, this); return false;" 
    onfocus="window.parent.CKFinder._.uiButtonFocus(1, event);" 
    onkeydown="window.parent.CKFinder._.uiButtonKeydown(1, event);" 
    onblur="this.style.cssText = this.style.cssText;" aria-labelledby="cke_10_label" 
    role="button" hidefocus="true" tabindex="-1" title="Refresh" 
    href="javascript:void('Refresh')" class="cke_button_refresh cke_off" id="cke_10" style="">
    <span class="cke_icon"></span>
    <span class="cke_label" id="cke_10_label">Refresh</span></a>

我尝试了以下代码示例,甚至尝试了根/通用标签,但都不起作用。

   $('span').click(function(){
     var t = $(this).text();
     alert(t);
   });

  $("#cke_10").click(function() { alert('cke_10'); });
  $("a").click(function() { alert('a click'); });
  $("a#cke_10").click(function() { alert('a cke click'); });
  $("#cke_10_label").click(function() { alert('cke label'); });
  $("span#cke_10_label").click(function() { alert('span cke label'); });

任何人都可以让刷新按钮在点击时发出警报?

【问题讨论】:

  • 一开始就包含了jQuery文件吗??
  • 是的,它是一个包含在内的主 jQuery 文件。

标签: jquery ckfinder


【解决方案1】:

事实证明,我有两个 ID 都设置为“id”,这会混淆刷新。然后使用此代码:https://stackoverflow.com/a/4249906/850904 我设法根据需要刷新了 iFrame。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-11
    • 1970-01-01
    • 2023-03-11
    • 1970-01-01
    相关资源
    最近更新 更多