/    Sign up×
Community /Pin to ProfileBookmark

window. setInterval() not working in Safari

I have a simple line of code:

[COLOR=”Blue”]window.setInterval(“refreshProgress()”, 1500);[/COLOR]

which is not working in Safari. It works fine in Firefox though.

(The refreshProgress() method is actually part of some ajax code to call a java Listener listing on a file upload. That part is working fine. I don’t think the problem is there)

Even when I try to do something as simple as:

[COLOR=”blue”]window. setInterval(“alert(‘hello’)”, 1500);[/COLOR]

I still can’t get it to work on Safari.

The same thing is happening if I substitute setTimeout() for setInterval().

Is there something I’m missing????

Any thoughts would be much appreciated

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Oct 06.2007 — Try using a reference such as:

Javascript:
[code=php]
window.setInterval(refreshProgress,1500);
[/code]
Copy linkTweet thisAlerts:
@milazzo6authorOct 06.2007 — yes, I thought of that, but it makes no difference.

The method

[COLOR="Blue"]setInterval("refreshProgress()", 1500)[/COLOR]

is actually inside a function embedded in a .js file:

[COLOR="blue"]

function startProgress()

{

document.getElementById('progressBar').style.display = 'block';

document.getElementById('progressBarText').innerHTML = 'upload in progress: 0%';

document.getElementById('uploadbutton').disabled = true;

// wait a little while to make sure the upload has started ..

window.setInterval("refreshProgress()", 1500);



return true;
}[/COLOR]

The first three lines of the function work fine - so, I'm assuming it's tripping up on the fourth.
×

Success!

Help @milazzo6 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...