تصدير (0) طباعة
توسيع الكل
EN
هذا المحتوى غير متوفر بلغتك ولكن ها هو الإصدار باللغة الإنجليزية.
اعتبر 9 من 23 هذا المحتوى مفيدًا - تصنيف هذا الموضوع

readystatechange | onreadystatechange event

Fires when the state of the object has changed.

Syntax

HTML Attribute <element onreadystatechange = "handler(event)">
Event Property object.onreadystatechange = handler;
attachEvent Method object.attachEvent("onreadystatechange", handler)
addEventListener Method object.addEventListener("readystatechange", handler, useCapture)

Event information

SynchronousNo
BubblesNo
CancelableNo

Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

Standards information

There are no standards that apply here.

Remarks

You can use the readyState property to query the current state of the element when the onreadystatechange event fires.

All elements expose an onreadystatechange event. The following objects always fire the event because they load data: applet, document, frame, frameSet, iframe, img, link, object, script, and xml elements. Other objects will only fire the onreadystatechange event when a DHTML Behavior is attached.

Note  For the script element, onreadystatechange is no longer supported. Starting with Internet Explorer 11, use onload. For info, see Compatibility changes.

When working with behaviors, wait for the onreadystatechange event to fire and verify that the readyState property of the element is set to complete to ensure that the behavior is completely downloaded and applied to the element. Until the onreadystatechange event fires, if you use any of the behavior-defined members before attaching the behavior to the element, a scripting error can result, indicating that the object does not support that particular property or method.

Signals the ready state of the document.

To invoke this event, do one of the following:

  • Change the ready state.

The pEvtObj parameter is required for the following interfaces:

Examples

This example uses the onreadystatechange event to invoke a function when the readyState is complete.


document.onreadystatechange=fnStartInit;
function fnStartInit()
{
   if (document.readyState=="complete")
   {
      // Finish initialization.
   }
}

See also

a
abbr
acronym
address
applet
area
audio
b
base
baseFont
bdo
bgSound
big
blockQuote
body
br
button
canvas
caption
center
cite
code
col
colGroup
comment
custom
dd
del
dfn
dir
div
dl
document
dt
em
embed
fieldSet
font
form
head
hn
hr
html
i
iframe
img
input type=button
input type=checkbox
input type=email
input type=file
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
ins
isIndex
kbd
label
legend
li
link
listing
map
marquee
menu
namespace
nextID
noBR
noFrames
noScript
object
ol
option
p
plainText
pre
q
rt
ruby
s
samp
script
select
small
source
span
strike
strong
style
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
title
tr
tt
u
ul
var
video
xml
xmp
Reference
onload
Conceptual
Introduction to Data Binding

 

 

هل وجدت هذا المحتوى مفيدًا؟
(1500 الأحرف المتبقية)
نشكرك على تقديم تعليقاتك
إظهار:
© 1435 Microsoft. All rights reserved.