jquery应该一次启用一个超链接

jquery one hyperlink should be enabled at a time

本文关键字:超链接 一个 启用 jquery 一次      更新时间:2023-09-26

我用Create User和Batch 创建了两个超链接

如果一个超点击的弹出窗口正在打开,同时其他超链接(批次)不应打开

(目前两者都已打开)

请告诉我如何解决这个问题??

请看我的代码:

var create = dojo.create("div",{
            id:"create_links",
            className:"iconRow1",
            innerHTML:"<a class='popupLink' href='javascript:openDialog()'>Create User</a> <span>|</span><a  href='javascript:openFileDialog()'>Batch </a>"
        }

function openDialog() {

        dojo.byId('create_links').disabled=true;
        $("#create_links").addClass("disabled");
// some code 

    }

另一个超链接代码是

  function openFileDialog() {

       $("#fileuploadfun").attr('title',"Batch");
       $( "#fileuploadfun" ).dialog({ position: 'center' , zIndex: 0, width: 500, show: 'slide', resizable:'false' });
    }
Currently the Dialog bOxes are created in this way :(This is for Batch)
  $("#fileuploadfun").attr('title',"Batch ");
       $( "#fileuploadfun" ).dialog({ position: 'center' , zIndex: 0, width: 500, show: 'slide', resizable:'false' });

用户对话框是这样创建的:

$( "#createUserDialog" ).dialog( "option", "title", 'Create User' );        
$( "#createUserDialog" ).dialog("open");

任何属性都不能禁用链接。禁用任何链接的方法是简单地删除onclick或将href替换为#或javascript:void(0),以避免跳到页面顶部。

相关文章: