search results for '2009/11/04'
- 2009/11/04 업로드전 이미지 미리보기
- 2009/11/04 IXMLDOMNode Interface
- 2009/11/04 IXMLDOMNodeList Interface
<html>
<head>
<title></title>
<style type="text/css">
.preView { width: 70px; height: 70px; text-align: center; border:1px solid silver; }
</style>
<script type="text/javascript">
function fileUploadPreview(thisObj, preViewer) {
if(!/(\.gif|\.jpg|\.jpeg|\.png)$/i.test(thisObj.value)) {
alert("이미지 형식의 파일을 선택하십시오");
return;
}
preViewer = (typeof(preViewer) == "object") ? preViewer : document.getElementById(preViewer);
var ua = window.navigator.userAgent;
if (ua.indexOf("MSIE") > -1) {
var img_path = "";
if (thisObj.value.indexOf("\\fakepath\\") < 0) {
img_path = thisObj.value;
} else {
thisObj.select();
var selectionRange = document.selection.createRange();
img_path = selectionRange.text.toString();
thisObj.blur();
}
preViewer.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fi" + "le://" + img_path + "', sizingMethod='scale')";
} else {
preViewer.innerHTML = "";
var W = preViewer.offsetWidth;
var H = preViewer.offsetHeight;
var tmpImage = document.createElement("img");
preViewer.appendChild(tmpImage);
tmpImage.onerror = function () {
return preViewer.innerHTML = "";
}
tmpImage.onload = function () {
if (this.width > W) {
this.height = this.height / (this.width / W);
this.width = W;
}
if (this.height > H) {
this.width = this.width / (this.height / H);
this.height = H;
}
}
if (ua.indexOf("Firefox/3") > -1) {
var picData = thisObj.files.item(0).getAsDataURL();
tmpImage.src = picData;
} else {
tmpImage.src = "file://" + thisObj.value;
}
}
}
</script>
</head>
<body>
<input id="fileData" name="fileData" type="file" onchange="fileUploadPreview(this, 'preView')" />
<div id="preView" class="preView" title="이미지미리보기"></div>
</body>
</html>
출처 : http://junyong.pe.kr/98
IXMLDOMNode Interface
Extends the core Node interface with support for data types, namespaces, DTDs, and schemas.
This interface inherits from IDispatch.
Methods
| appendChild | Appends newChild as the last child of this node. |
| attributes | Contains the list of attributes for this node. |
| * | Returns the base name for the name qualified with the namespace. |
| childNodes | Contains a node list containing the children (for nodes that can have children). |
| cloneNode | Creates a new node that is an exact clone of this node. |
| dataType* | Specifies the data type for this node. |
| definition* | Returns the definition of the node in the DTD or schema. |
| firstChild | Contains the first child of this node. |
| hasChildNodes | Returns True if this node has children. |
| insertBefore | Inserts a child node to the left of the specified node or at the end of the list. |
| lastChild | Returns the last child node. |
| namespaceURI* | Returns the URI for the namespace. |
| nextSibling | Contains the next sibling of this node in the parent's child list. |
| nodeName | Contains the qualified name of the element, attribute, or entity reference, or a fixed string for other node types. |
| nodeType | Specifies the DOM node type, which determines valid values and whether the node can have child nodes. |
| nodeTypeString* | Returns the node type in string form. |
| nodeTypedValue* | Contains this node's value, expressed in its defined data type. |
| nodeValue | Contains the text associated with the node; depends on the node type. |
| ownerDocument | Returns the root of the document that contains this node. |
| parentNode | Contains the parent node (for nodes that can have parents). |
| parsed* | Indicates whether this node and all descendants have been parsed and instantiated. |
| prefix* | Returns the namespace prefix. |
| previousSibling | Contains the left sibling of this node. |
| removeChild | Removes the specified child node from the list of children and returns it. |
| replaceChild | Replaces the specified old child node with the supplied new child node in the set of children of this node, and returns the old child node. |
| selectNodes* | Applies the specified pattern to this node's context and returns the list of matching nodes. |
| selectSingleNode* | Applies the specified pattern to this node's context and returns the first matching node. |
| specified* | Indicates whether the node (usually an attribute) is explicitly specified or derived from a default value in the DTD or schema. |
| text* | Contains the text content of the node and its subtrees. |
| transformNode* | Processes this node and its children using the supplied XSL style sheet and returns the resulting transformation in a string. |
| transformNodeToObject* | Processes this node and its children using the supplied XSL style sheet and returns the resulting transformation in the supplied object. |
| xml* | Contains the XML representation of the node and all its descendants. |
* denotes an extension to the W3C DOM.
Requirements
Implementation: Msxml.dll
Header and IDL files: Msxml.h, Xmldom.idl
IXMLDOMNodeList Interface
Supports iteration through the live collection, in addition to indexed access.
This interface inherits from IDispatch.
Methods
| item | Allows random access to individual nodes within the collection. |
| length | Indicates the number of items in the collection. |
| nextNode | Returns the next node in the collection. |
| reset | Resets the iterator. |
Remarks
A NodeList collection is live; that is, the addition and removal of nodes, and changes within nodes, are immediately reflected in the collection. This means that two successive requests for items using the same index can return two different items, depending on changes to the collection. This also means that changes to the node objects are immediately available in the nodes obtained from the list. The collection can also be accessed using the "for...next" construct.
Requirements
Implementation: Msxml.dll
Header and IDL files: Msxml.h, Xmldom.idl
comment