initiatorType
read-only property is a
string
表示
type
of resource that initiated the performance event.
The value of this string is as follows:
元素
, the property returns the element's
localName
.
CSS
resource, the property returns "
css
".
XMLHttpRequest
object, the property returns "
xmlhttprequest
".
PerformanceNavigationTiming
object, the property returns an empty string (
""
).
resource.initiatorType;
A
string
表示
type
of resource that initiated the performance event, as specified above.
function print_PerformanceEntries() {
// Use getEntriesByType() to just get the "resource" events
var p = performance.getEntriesByType("resource");
for (var i=0; i < p.length; i++) {
print_initiatorType(p[i]);
}
}
function print_initiatorType(perfEntry) {
// Print this performance entry object's initiatorType value
var value = "initiatorType" in perfEntry;
if (value)
console.log("... initiatorType = " + perfEntry.initiatorType);
else
console.log("... initiatorType = NOT supported");
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
Resource Timing Level 1
The definition of 'initiatorType' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
initiatorType
|
Chrome 43 | Edge 12 | Firefox 40 | IE No | Opera 30 | Safari 11 | WebView Android 43 | Chrome Android 43 | Firefox Android 42 | Opera Android 30 | Safari iOS 11 | Samsung Internet Android 4.0 |
完整支持
不支持
PerformanceResourceTiming