简体   繁体   English

Chrome浏览器按钮问题

[英]Chrome Browser Issue for Button

I have an issue with a Button. 我的按钮有问题。 It is appearing in IE and Firefox, but not appearing in Chrome. 它出现在IE和Firefox中,但没有出现在Chrome中。

The code for the button is using Rally API and it's generated while loading the page. 按钮的代码使用Rally API,并且在加载页面时生成。

I have tried Googling the answer, but I couldn't find anything. 我已经尝试使用Google搜索的答案,但找不到任何东西。

Heres my code: 这是我的代码:

function onClick(b, args) {
    if(OneButtonClickFlag == true) {
        OneButtonClickFlag = false;
        var buttonValue = args.value;
        var userName = "__USER_NAME__";
        TimeSheetReport(); // calling the “timesheet report “

    }
}

function onLoad() {
    var config = {
        text: "Generate",
        value: "myValue"
    };

    var button = new rally.sdk.ui.basic.Button(config);
    button.display("buttonDiv", onClick); // call the “onclick” function 
}

rally.addOnLoad(onLoad);

This App below seems to work with your code in it up until the point where it encounters your OneButtonClick flag. 下面的这个应用程序似乎可以在其中使用您的代码,直到遇到您的OneButtonClick标志为止。 I tested it in Chrome. 我在Chrome浏览器中对其进行了测试。 Does this work for you? 这对您有用吗?

<head>
    <title>Button Example</title>
    <meta name="Name" content="Component Example: Button"
    />
    <meta name="Version" content="2010.4" />
    <meta name="Vendor" content="Rally Software" />
    <script type="text/javascript" src="https://rally1.rallydev.com/apps/1.26/sdk.js"></script>
    <script type="text/javascript">
        function onClick(b, args) {
            console.log("works until this undefined variable");
            if (OneButtonClickFlag == true) {
                OneButtonClickFlag = false;
                var buttonValue = args.value;
                var userName = "__USER_NAME__";
                TimeSheetReport(); // calling the “timesheet report “

            }
        }

        function onLoad() {
            var config = {
                text: "Generate",
                value: "myValue"
            };

            var button = new rally.sdk.ui.basic.Button(config);
            button.display("buttonDiv", onClick); // call the “onclick” function 
        }

        rally.addOnLoad(onLoad);
    </script>
</head>

<body>
    <div id="buttonDiv"></div>
</body>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM