相关疑难解决方法(0)

setTimeout()似乎不适用于Firefox?

我继承了一个网站!它被设计为在IE中工作,只有IE似乎......我现在被要求让网站在Firefox中运行.我已经修复了大部分的bug而没有任何问题,但这个让我感到难过.

setTimeout(fDelayedFunc,1000);

这行Javascript,在IE中工作正常,但在Firefox中函数fDelayedFunc永远不会触发.我已经删除了setTimeout和函数包装器,并尝试将代码作为main函数的一部分运行.这完全没有任何问题.

有很多代码涉及但这里是主要但我遇到了麻烦.如果您想再看到代码,请告诉我.

            setTimeout(fDelayedFunc, 0);

            //Save the current text box value
            var vCurrentTBValue = vJQElement.val();

            function fDelayedFunc() {

                if (vJQElement.val() == vCurrentTBValue) {
                    alert("test");

                    //Get position list box should appear in
                    var vTop = vJQElement.position().top + 25;
                    var vLeft = vJQElement.position().left;

                    //Had to put a special case in for account due to the position co-ords being wrong. This is due to a css error
                    if (vHiddenFieldToWriteTo == "#ctl00_ContentPlaceHolder1_hfAccountCode") {
                        vTop = vJQElement.position().top + 58;
                        vLeft = vJQElement.position().left + 200; …
Run Code Online (Sandbox Code Playgroud)

javascript

5
推荐指数
1
解决办法
1万
查看次数

setTimeout使用问题

我有以下javascript但我在使用setTimeout时遇到问题,即:

function setUrl()
{
  // Get system URL details
  var url_path = new String(window.location.pathname);

  var new_url;

  new_url = window.location.host;
  }
  setTimeout("setValue('ONE_UP_URL',new_url);",2000);
}
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,我收到错误:'new_url'未定义.

非常感谢您使用setTimeout调用此javascript函数的帮助.

谢谢.

javascript

0
推荐指数
2
解决办法
596
查看次数

标签 统计

javascript ×2