aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/globalobject.qdoc
blob: 47687022b144c7df723890768f7087eb0d9ce078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms
** and conditions contained in a signed written agreement between you
** and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
\page qdeclarativeglobalobject.html
\inqmlmodule QtQuick 2
\title QML Global Object

Contains all the properties of the JavaScript global object, plus:

\tableofcontents

\section1 Qt Object

The \l{QmlGlobalQtObject}{Qt object} provides useful enums and functions from Qt, for use in all QML
files. 

\section1 XMLHttpRequest

\target XMLHttpRequest

QML script supports the XMLHttpRequest object, which can be used to asynchronously obtain 
data from over a network.  

The XMLHttpRequest API implements the same \l {http://www.w3.org/TR/XMLHttpRequest/}{W3C standard}
as many popular web browsers with following exceptions:
\list
\o QML's XMLHttpRequest does not enforce the same origin policy.
\o QML's XMLHttpRequest does not support \i synchronous requests.
\endlist

Additionally, the \c responseXML XML DOM tree currently supported by QML is a reduced subset
of the \l {http://www.w3.org/TR/DOM-Level-3-Core/}{DOM Level 3 Core} API supported in a web
browser.  The following objects and properties are supported by the QML implementation:

\table
\header
\o \bold {Node}
\o \bold {Document}
\o \bold {Element}
\o \bold {Attr}
\o \bold {CharacterData}
\o \bold {Text}

\row
\o 
\list
\o nodeName
\o nodeValue
\o nodeType
\o parentNode
\o childNodes
\o firstChild
\o lastChild
\o previousSibling
\o nextSibling
\o attributes
\endlist

\o 
\list
\o xmlVersion
\o xmlEncoding
\o xmlStandalone
\o documentElement
\endlist

\o
\list 
\o tagName
\endlist

\o
\list
\o name
\o value
\o ownerElement
\endlist

\o
\list 
\o data
\o length
\endlist

\o
\list
\o isElementContentWhitespace
\o wholeText
\endlist

\endtable

The \l{declarative/xml/xmlhttprequest}{XMLHttpRequest example} demonstrates how to
use the XMLHttpRequest object to make a request and read the response headers.

\section1 Logging

\c console.log(), \c console.debug(), \c console.time(), and \c console.timeEnd() can be used to print information
to the console. See \l{Debugging QML} for more information.

*/