<template>
</template>

<script>
export default {
  name: "sample", //컴포넌트 이름
  components: {}, // 외부 컴포턴트를 사용하게 되면, 해당 컴포넌트를 import한 후 등록 해주어야 한다.
  data() {
    return {
    };
  }, // 전역 데이터 선언 (html, js간의 양방향 데이터 방린딩 가능하며, 데이터 프로퍼티는 this로 접근해야 한다.
  setup() {}, // 컴포지션 API를 구현하는 메소드
  created() {}, // 컴포넌트 생성시 실행
  mounted() {}, // template에 정의된 html코드가 랜더링 된 후 실행
  unmounted() {}, // unmount 이후 실행
  methods: {} // 컴포넌트 내에서 사용할 메소드 정의

};
</script>

<style>
</style>

참고 : https://seungdols.tistory.com/959

'Html-JavaScript' 카테고리의 다른 글

AngularJS 개체 복사 비교 angular.copy  (0) 2017.10.25
스타일로 제목 자르기  (0) 2011.05.23
클립보드에 복사  (0) 2008.10.15
문자열 length구하기  (0) 2008.07.22
웹에서 이미지의 특정색을 투명하게 처리  (0) 2007.10.16

        $scope.test1 = {

        label : "test"

        }

        

        $scope.test2 = {};

        $scope.test3 = {};

        

        test();

        

        function test() {

        console.log("-------------------------");

        testPrint();

        testCopy();

        console.log("-------------------------");

        testPrint();

        console.log("-------------------------");

        $scope.test1.label = "TEST";

        testPrint();

        }

        

        function testCopy() {

        $scope.test2 = $scope.test1;

        angular.copy($scope.test1,$scope.test3);

        }

        

        function testPrint() {

        console.log("$scope.test1");

        console.log($scope.test1);

        console.log("$scope.test2");

        console.log($scope.test2);

        console.log("$scope.test3");

        console.log($scope.test3);

       

        }




결과

-------------------------
$scope.test1
{label: "test"}
$scope.test2
{}
$scope.test3
{}
-------------------------
$scope.test1
{label: "test"}
$scope.test2
{label: "test"}
$scope.test3
{label: "test"}
-------------------------
$scope.test1
{label: "TEST"}
$scope.test2
{label: "TEST"}
$scope.test3
{label: "test"}


'Html-JavaScript' 카테고리의 다른 글

Vue.js 기본 구조  (0) 2024.02.28
스타일로 제목 자르기  (0) 2011.05.23
클립보드에 복사  (0) 2008.10.15
문자열 length구하기  (0) 2008.07.22
웹에서 이미지의 특정색을 투명하게 처리  (0) 2007.10.16

style="overflow: hidden; white-space:nowrap; text-overflow:ellipsis; -o-text-overflow: ellipsis;"

글자가 넘어가면 걸치지 않고 자동으로 ... 표시됨

폭을 %로 지정한 경우에 윈도우 사이즈가 변해도 변한 사이즈 만큼 글자표시도 변함

IE6 이하에서는 정상적으로 작동하지 않으니

크로스부라우징을 디테일하게 체크하는 경우에는 사용할 수 없음

'Html-JavaScript' 카테고리의 다른 글

Vue.js 기본 구조  (0) 2024.02.28
AngularJS 개체 복사 비교 angular.copy  (0) 2017.10.25
클립보드에 복사  (0) 2008.10.15
문자열 length구하기  (0) 2008.07.22
웹에서 이미지의 특정색을 투명하게 처리  (0) 2007.10.16

var str = "클립보드에 복사할 내용";

window.clipboardData.setData("Text",str);

//문자열 length구하기
function getByteLength(val)
{
var tmplen = 0;
for (var i = 0; i < val.length; i++)
{
if (val.charCodeAt(i) > 127)
tmplen += 2;
else
tmplen++;
}
return tmplen;
}



아래 링크에서 개선된 방식 비교 (속도 빠름)
http://programmingsummaries.tistory.com/239


function getByteLength(s,b,i,c){
    for(b=i=0;c=s.charCodeAt(i++);b+=c>>11?3:c>>7?2:1);
    return b;
}


style="{FILTER:Chroma(Color='#ffffff')}

'Html-JavaScript' 카테고리의 다른 글

클립보드에 복사  (0) 2008.10.15
문자열 length구하기  (0) 2008.07.22
플래쉬 바탕이 투명하게 불러오기  (0) 2007.09.13
[JavaScript] string.trim() 메서드  (0) 2007.01.09
[HTML] tabindex 지정하기  (0) 2007.01.09
<param name="wmode" value="Transparent">

String.prototype.trim = function()
{
// 문장의 앞과 뒤의 공백 제거
//return this.replace(/^s*(b.*b|)s*$/, "$1");
a = this
var search = 0
while ( a.charAt(search) == " ")
search = search + 1

a = a.substring(search, (a.length))
search = a.length - 1
while (a.charAt(search) ==" ")
search = search - 1
return a.substring(0, search + 1)
}


사용은...

document.forname.object.value.trim()

<html>
<head>
<title> new document </title>
</head>
<body>
<input type="text" name="1" tabindex="1">
<input type="text" name="3" tabindex="3">
<input type="text" name="5" tabindex="5">
<input type="text" name="7" tabindex="7">
<input type="text" name="9" tabindex="9">
<input type="text" name="8" tabindex="8">
<input type="text" name="6" tabindex="6">
<input type="text" name="4" tabindex="4">
<input type="text" name="2" tabindex="2">
</body>
</html>

오늘은 그만열기의 샘플소스

========================팝업여는쪽 소스======================
<html>
<head><title></title>
<script language="JavaScript">
<!--
function getCOOKIE(name)
{
var Found;
Found = false;
var start, end;
var i = 0;

while(i <= document.COOKIE.length)
{
start = i;
end = start + name.length;
if(document.COOKIE.substring(start, end) == name)
{
//Found = true;
return true;
break;
}
i++;
}

if(Found == true)
{
start = end + 1;
end = document.COOKIE.indexOf(';', start);
if(end < start)
end = document.COOKIE.length;
return document.COOKIE.substring(start, end);
}
return '';
}

function openPopup()
{
if (getCOOKIE('popup') != true)
window.open('popup.html', 'popup', 'left=0,top=0,toolbar=no,status=no,width=400,height=400,directories=no,scrollbars=no,Location=no,resizable=no,menubar=no');
}
//-->
</script>
</head>
<body onLoad="JavaScript:openPopup();">
...
</body>
</html>
============================================================


========================팝업쪽 소스==========================
<html>
<head><title><title>
<script language="JavaScript">
<!--
//다시 열지 않기 선택시 -- setCOOKIE("화일명","y",1) 화일명을 수정해주고 메인에도 같이 수정해 줄것.
function controlCOOKIE()
{
setCOOKIE("popup","y", 1)
window.close();
}
//쿠키 생성 함수

function setCOOKIE(name, value, expire)
{
var expire_date = new Date()
expire_date = new Date(expire_date.getTime() + 60*60*24*1000)
document.COOKIE = name + "=" + escape(value) + "; expires=" + expire_date.toGMTString() +"; path=/";
self.close();
}

//쿠키 소멸 함수
function clearCOOKIE(name)
{
var today = new Date()
//어제 날짜를 쿠키 소멸 날짜로 설정한다.
var expire_date = new Date(today.getTime() - 60*60*24*1000)
document.COOKIE = name + "= " + "; expires=" + expire_date.toGMTString()
}

function closeWindow()
{
window.close();
}
//-->
</script>
</head>
<body>
.
생략
.
.
.
.

<input type="checkbox" name="nopopup" onClick="JavaScript:controlCOOKIE();"> 오늘은 그만 열기 <input type="button" name="closepopup" value="close" onClick="JavaScript:closeWindow();">
============================================================
</body>
</html>

+ Recent posts