레이블이 javascript인 게시물을 표시합니다. 모든 게시물 표시
레이블이 javascript인 게시물을 표시합니다. 모든 게시물 표시

2009년 3월 18일 수요일

Javascript Object Table


출처: http://www.jasko.co.kr/lesson/object_table.html#history%20array



Anchor | anchors array | Applet | applets array | Area | Array | Button | Checkbox | Date | document | FileUpload | Form | forms array | frames array | Hidden | History | history array | Image | images array | Layers | layers array | Link | links array | location | Math | MimeType | mimeTypes array | navigator | Number | Option | options array | Password | Plugin | plugins array | Radio | radio array | Reset | screen | Select | String | Submit | Text | Textarea | window

 

※ 녹색은 네츠케이프, 혹은 익스플로러 전용으로만 사용되는 객체(속성,메소드)입니다

객체(Object)

속성(Property)

메소드(Method)

이벤트핸들러(Event Handler)

Anchor

name
text
x
y



anchors array

length



Applet


applet's methods


applets array

length



Area

hash
host
gostname
href
pathname
port
protocol
search
target


onClick
onmouseOut
onmouseOver

Array

length

concat
join
pop
push

reverse
shift
slice
sort
unshjft


Button

form
name
type
value

blur
click
focus

onClick
onmouseDown
onmouseUp

Checkbox

checked
defaultChecked
form
name
type
value

blur
click
focus

onClick
onmouseDown
onmouseUp

Date


getDate
getDay
getFullYear
getHours
getMilliseconds
getMinutes
getMonth
getSeconds
getTime
getTimezoneOffset
getUTCDate
getUTCDay
getUTCFullYear
getUTCHours
getUTCMilliseconds
getUTCMinutes
getUTCMonth
getUTCSeconds
getYear
parse
setDate
setFullYear
setHours
setMilliseconds
setMinutes
setMonth
setSeconds
setTime
setUTCDate
setUTCHours
setUTCMilliseconds
setUTCMinutes
setUTCMonth
setUTCSeconds
setYear
goGMTString
toLocaleString
toString
toUTCString
UTC
valueOf


document

activeElement
alinkColor
all
Anchor
anchors
Applet
applets
Area
bgColor
body
charset
children

cookie
defaultCharset
domain
embed
embeds
expando

fgColor
Form
forms
Image
images

lastModified
Layer
layers

linkColor
Link
links
location
parentWindow
plugins

readyState
referrer
scripts
selection
styleSheets

title
URL
vlinkColor

clear
close
createElement
createStylesheet
elementFromPoint
getSelection

open
write
writeIn


FileUpload

form
name
type
value

blur
focus

select

onBlur
onFocus
onSelect

Form

action
Button
Checkbox
elements
encoding
FileUpload
Hidden
length
method
name
Password
Radio
Reset
Select
Submit
target
Text
Textarea

reset
submit

onReset
onSubmit

forms array

length



frames array

length



Hidden

form
name
type
value



History

current
length
next
previous

back
foward
go


history array

length



Image

border
complete
height
hspace
lowsrc
name
src
vspace
width
x
y


onAbort
onError
onLoad

images array

length



Layers

above
background
below
bgColor
clip
document
hidden
left
name
pageX
pageY
parentLayer
siblingAbove
siblingBelow
src
top
visibility
window
x
y
zindex

load
moveAbove
moveBelow
moveBy
moveTo
moveToAbsolute
resizeBy
resizeTo

onBlur
onFocus
onmouseOut
onmouseOver
onmouseUp

layers array

length



Link

hash
host
hostname
href
pathname
port
protocol
search
target
text
x
y


onClick
onmouseOut
onmouseOver

links array

length



location

hash
host
hostname
href
pathname
port
protocol
search

reload
replace


Math

E
LN2
LN10
LOG2E
LOG10E
PI
SQRT1_2
SQRT2

abs
acos
asin
atan
atan2
ceil
cos
exp
floor
log
max
min
pow
random
round
sin
sqrt
tan


MimeType

description
enabledPlugin
suffixes
type



mimeTypes array

length



navigator

appCodeName
appMinorVersion
appName
appVersion
browserLanguage
cookieEnabled
cpuClass
languages
mimeTypes

platform
plugins
systemLanguage

userAgent
userLanguage
userProfile

javaEnabled
preference
savePreferences
taintEnabled


Number

MAX_VALUE
MIN_VALUE
NaN
NEGATIVE_INFINITY
POSITIVE_INFINITY

toString
valueOf


Option

defaultSelected
index
selected
selectedIndex
text
value



options array

length



Password

defaultValue
form
name
type
value

blur
focus
select

onBlur
onChange
onFocus
onKeydown
onKeypress
onKeyup
onSelect

Plugin

description
filename
name

refresh


plugins array

length



Radio

checked
defaultChecked
form
name
type
value

blur
click
focus

onClick
onmouseDown
onmouseUp

radio array

length



Reset

form
name
type
value

blur
click
focus

onClick
onmouseDown
onmouseUp

screen

availHeight
availLeft
availTop

availWidth
BufferDepth
colorDepth
height
pixelDepth
updayeInterval
width



Select

form
length
name
options
selectedIndex
type

blur
focus

onChange

String

length

anchor
big
blink
bold
charAt
charCodeAt
concat
fixed
fontcolor
fontsize
formCharCode
indexOf
italics
lastIndexOf
link
match
replace
search
slice
small
split
strike
sub
substr
substring
sup
toLowerCase
toUpperCase


Submit

form
name
type
value

blur
click
focus

onClick
onMouseDown
onMouseUp

Text

defaultValue
form
name
type
value

blur
click
focus
select

onBlur
onChange
onFocus
onKeydown
onKeyup
onSelect

Textarea

defaultValue
form
name
type
value

blur
click
focus
select

onBlur
onChange
onFocus
onKeydown
onKeyup
onSelect

window

clientInformation
closed

defaultStatus
dialogArguments
dialogHeight
dialogLeft
dialogLeft
dialogTop
dialogWidth

document
event
frames
history
innerHeight
innerWidth

length
location
locationbar
menubar

name
navigator
offscreenBuffering
opener
outerHeight
outerWidth
pageXOffset
pageYOffset

parent
personalbar
screen
screenX
screenY
scrollbars

self
status
statusbar

toolbar
top

alert
back
blur

close
confirm
find
focus
forward
home
moveBy
moveTo
navigate

open
print
prompt
resizeBy
resizeTo

scroll
scrollBy
scrollTo
stop

onBlur
onError
onFocus

onLoad
onResize
onUnload


2008년 11월 13일 목요일

JQuery 를 이용한 html와 script 와 분리


요새 prototype.js 를 이용해, javascript 를 깔끔하게, 효율적으로

만드는 방안으로 생각 하고 있는 도중, JQuery 를 알게 되었다.

그런데 이게, JQuery 예제를 이용하던 도중 이것을 이용하면,

디자이너가 HTML를 넘기면 id 및 name 를 세팅하여, 넘겨주면,

스크립트 작업 후 개발을 할때, 디자인이 수정되어도, 가공된 페이지에 변경 없이 작업을 할수 가 있다고 생각이

들었다. Greate!!

물론 prototype 를 이용해 할수도 있는데 흠.. JQuery 를 이용하면 좀더 효율 적으로 할 수 있다.




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title>Untitled Document</title>

<script type="text/javascript" src="script/jquery-1.2.6.js"></script>
<script type="text/javascript">

 $(document).ready(
  function (){
   $("#textcubeLink").click(
    function(){
     alert("empas image click");
    }
   ).css("cursor", "pointer");
   
   $("#blogLink").click(
    function(){
     location.href = "http://taesuz.net/tt/";
    }
   ).css("cursor", "pointer");
   
   

  }
 
 
 );

</script>

<style type="text/css">
    .links { cursor: pointer; }
 </style>

</head>

<body>

<a id="blogLink">taesuz.net 링크</a>
<br />
<br />
<img src="http://taesuz.net/tt/skin/ReinerSchwarzKoreanisch/images/textcube.jpg" id="textcubeLink" />

</body>
</html>


보시다 시피, 분리가 될수 있다. html 디자인은 그대로 있지만, 링크나, 스크립트 제어 부분이 완전히 분리되어있다.

좀더 공부 하면, 보다 깔금하게 효율적으로 분리가 되어 제어 가능하지 않을까?

이 얼마나 알흠다운가 ㅎㅎ

앞으로 효율적으로 활용해 봐야겠다.

2008년 6월 19일 목요일

2008년 1월 24일 목요일

self.close() 사용시 이 창을 닫으시겠습니까? 없얘기..


 


self.close();

를 사용할시에 팝업이 뜨면서 예 아니오 버튼이 나오게 된다.

이것이 나오지 않고,

바로 닫게 하는 자바스크립트이다.


[code type=javascript] if (/MSIE/.test(navigator.userAgent)) {
  if(navigator.appVersion.indexOf("MSIE 7.0")>=0) {
   window.open('about:blank','_self').close();
  } else {
     window.opener = self;
     self.close();
  }                      
 }
[/code]

2007년 7월 20일 금요일

서로다른 도메인에서 Access 가능 스크립트

부모창,자식창에 각각 다음 소스를 삽입하세요..



[code type=javascript]<script language=javascript>

//주소는 본인의 사이트 주소 입력
document.domain="www.xxx.co.kr"

</script>
[/code]


document 오브젝브의 domain속성은 일종의 보안 목적으로 사용 됩니다.

구체적으로 말씀 드리자면.. 서로 다른 웹사이트의 페이지를 익스플로러 창 두개를

띄워서 각각 읽고 있다고 가정시에.. 두 페이지는 서로 어떠한 속성도 줄수도,읽을수도 없습니다.
예를 들자면, A사이트에서 팝업으로 B사이트의 페이지를 열었을때 B사이트의 페이지에서는

A사이트의 숨겨진 속성을 사용할수 없습니다.. 또, 이것이 정석이지요..각각의 보안효과를 위해서는..



그런데 이런 문제가 발생할수 있습니다.

www.yahoo.co.kr 과 search.yahoo.co.kr 은 같은 회사의 웹페이지 임에도 불구 하고,

위에서 말씀드린 이론대로라면, 서로 어떤 속성도 주고 받을수 없습니다. 로드된

웹서버 도메인이 다르기 때문이지요.. 그러나 이럴때 두 페이지에..



<script language=javascript>

document.domain="yahoo.co.kr"

</script>



을 삽입하게 되면, 서로 다른 웹서버에서 로드 되었다 해도,  두 페이지는 서로의

속성을 모두 사용할수 있습니다. 공통된 도메인을 명시 하였기 때문이죠..

이럴때, document.domain 메소드를 사용하는 것입니다.

출처 : Tong - 몹쓸강아지님의 JavaScript통

2007년 4월 16일 월요일

쿠키를 이용한 아이디 저장..


친구가 일하면서 나에게 숙제를 줘서.. 하다보니까 나중에 써먹을 일이 있을꺼 같아서..

대충 구현하고 포스팅~

------------------------------------------------------------------------------------------------
[code type=javascript]
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>쿠키</title>
<script language="javascript">
 //document.onreadystatechange=function(){
 // if(document.readyState == "complete") chkCookie();
 //}
 function setCookie (name, value) {
  if (confirm('ID를 저장하시겠습니까?'))
  {
   if (document.loginFrm.isCheck.checked)
   {
    var expdate = new Date();
    expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 7);     var sTmpStr = name + "=" + escape (value) + "; expires=" + expdate;
    document.cookie = sTmpStr;
    //alert('쿠키값저장 = ' + sTmpStr);    }
  }
 }  function getCookie(Name) {
  var search = Name + "="
  if (document.cookie.length > 0) {
   offset = document.cookie.indexOf(search)
   if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset)
    if (end == -1)
     end = document.cookie.length
    return unescape(document.cookie.substring(offset, end))
   }
  }
  return "";
 }
 function deleteCookie( cookieName ){
  document.cookie = cookieName+"=; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
  location.reload();
 }  function chkCookie(){   var isCookie = document.loginFrm;
  if (getCookie('uid') != "")
  {
   document.loginFrm.isCheck.checked = true;
   document.loginFrm.uid.value=getCookie('uid');
  }
  else
  {
   document.loginFrm.uid.value='';
   document.loginFrm.isCheck.checked = false;
  }
 }
</script>
</head>
<body onload="chkCookie();"> <form name="loginFrm" action="test1.html">
 <input type="text" name="uid">
 <input type="checkbox" onclick="javascript:setCookie('uid', document.loginFrm.uid.value);" name="isCheck"><br>
 <input type="submit" value="확인">
 <input type="button" value="삭제" onclick="javascript:deleteCookie('uid');">
</form>
</body>
</html> [/code]

2006년 9월 1일 금요일

JavaScript 부모창 새로고침..

  • 자식창에서 opener.location.reload()
  • opener.parent.location.href = reload시키려는 페이지