Javascript [Electronic resources] : The Definitive Guide (4th Edition) نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Javascript [Electronic resources] : The Definitive Guide (4th Edition) - نسخه متنی

David Flanagan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


Availability




JavaScript 1.2; IE 4 supports only one of the two forms


Synopsis

window.setInterval(code, interval)
window.setInterval(func, interval,args...)

Arguments


code

A string of JavaScript code to be periodically executed. If this
string contains multiple statements, they must be separated from each
other by semicolons.

func

A JavaScript function to be periodically executed. This form of the
method is not available in IE 4.

interval

An integer that specifies the interval, in milliseconds, between
invocations of code or
func.

args...

Any number of arbitrary values to be passed as arguments to each
invocation of func.


Returns


A value that can be passed to Window.clearInterval(
) to cancel the periodic execution of
code or func.


Description


setInterval( ) repeatedly executes the JavaScript
statements specified in the string code,
at intervals of interval milliseconds.

In Netscape 4, but not IE 4, a function may be passed as the first
argument instead of a string. In this form of setInterval(
), the specified function, func,
is repeatedly invoked, at intervals of
interval milliseconds. Any additional
argument values, args, passed to
setInterval( ) are passed as arguments to each
invocation of func( ).

In both forms, the setInterval( ) method returns a
value that can later be passed to Window.clearInterval(
) to stop code or
func from being repeatedly executed.

setInterval( ) is related to setTimeout(
). Use setTimeout( ) when you want to
defer the execution of code but do not want it to be repeatedly
executed.


See Also


Window.clearInterval( ), Window.setTimeout( )

/ 844