Posted
Filed under Htm&Javascript
[출처] - http://everyharu.tistory.com/11

<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv=Cache-Control content=No-Cache>
<meta http-equiv=Pragma content=No-Cache>
<title>Map Search</title>
</head>
<body style="margin:0px 0px 0px 0px">
<script type="text/JavaScript" src="http://maps.naver.com/js/naverMap.naver?key=지도키 넣는곳"></script>
<div id='mapContainer' style='width:960px;height:550px'> </div>
<script type="text/javascript">
// 기본 지도 생성
 var mapObj = new NMap(document.getElementById('mapContainer'), 700, 550);
    mapObj.setBound(319198, 527730, 323198, 531730);
//지도 좌표에 아이콘 삽입
    var iconUrl = "logo.gif";   //logo.gif라는 파일을 아이콘으로 지정해줍니다.
    var iconSize = new NSize(40, 35);   //아이콘의 사이즈를 지정해 줍니다.
    var markObj = new NMark(new NPoint(309360, 551717), new NIcon(iconUrl, iconSize));
    mapObj.setCenterAndZoom(new NPoint(309338, 551717), 0);
    //setCenterAndZoom(point, zoom_level) 라는 함수는 지도가 나오자마자의 위치를 나타내 주는 함수입니다. point부분에 좌표, zoom_level 부분은 줌의 확대 축소 정도입니다. 0~15까지로 나뉘어 있으며, 0에 가까울수록 지도가 확대 됩니다.
    mapObj.zoomOut();     //줌아웃을 해줍니다. 즉 바로 위에서 0->1, 만약 10이었으면 10->11로 줌 상태가 축소됩니다.
// 생성한지도에 아이콘 추가
 mapObj.addOverlay(markObj);
    // 확대, 축소를 위한 컨트롤을 생성한다.
    var zoom = new NZoomControl();
    zoom.setAlign("right");
    zoom.setValign("bottom");
    mapObj.addControl(zoom);
</script>
</body>
</html>
2011/01/26 08:08 2011/01/26 08:08
Posted
Filed under Htm&Javascript
[출처] - http://ajaxis.tistory.com/42

1. 시작페이지 설정 :


    <a href="javascript://"
          onclick="this.style.behavior='url(#default#homepage)'; this.setHomePage        ('http://www.adic.co.kr');">
          <img src="이미지.gif"> </a>
 


2. 즐겨찾기 설정 :

      <a href="javascript:myFavorite()">
          <img src="이미지.gif" border="0"></a>


   <script language="javascript">
 
   function myFavorite() {
      window.external.AddFavorite('http://xxxxxx.com/', '바람의 검객!')
   }
 
  </script>

2011/01/25 06:48 2011/01/25 06:48
Posted
Filed under Htm&Javascript
// Clipboard Copy Alert
function copy_text()
{
    if (window.event)
    {
        window.event.returnValue = true;
        window.setTimeout('copy_text2()', 25);
    }
}
function copy_text2()
{
    if (window.clipboardData) // IE
    {
        var result = window.clipboardData.setData('Text', "복사할 텍스트");
        alert ("텍스트가 복사되었습니다. 붙여넣기(Ctrl + V)하면 됩니다.");
    }
}
</script>
<input type="button" value="복사" onclick="javascript:copy_text();">
2011/01/14 10:51 2011/01/14 10:51
Posted
Filed under Htm&Javascript
style="cursor:pointer"
를 사용 하면 IE/FF 에서 모두 표시 됩니다.
2010/12/27 12:22 2010/12/27 12:22
Posted
Filed under Htm&Javascript
[원문] - http://www.mcfedries.com/javascript/timer.asp

<SCRIPT LANGUAGE = "JavaScript"> <!-- var secs var timerID = null var timerRunning = false var delay = 1000 function InitializeTimer() { // Set the length of the timer, in seconds secs = 10 StopTheClock() StartTheTimer() } function StopTheClock() { if(timerRunning) clearTimeout(timerID) timerRunning = false } function StartTheTimer() { if (secs==0) { StopTheClock() // Here's where you put something useful that's // supposed to happen after the allotted time. // For example, you could display a message: alert("You have just wasted 10 seconds of your life.") } else { self.status = secs secs = secs - 1 timerRunning = true timerID = self.setTimeout("StartTheTimer()", delay) } } //--> </SCRIPT>
To use this script, copy everything between and including the <SCRIPT> and </SCRIPT> tags and insert it on your page between the </HEAD> and <BODY> tags.

The following line sets the length, in seconds, of the timer:

secs = 10

The code decreases the "secs" variable by 1 each second. When "secs" gets to 0, the clock is stopped and that's when you do whatever it is you want to do once the timer is done (such as display a message or send the user to another page).

In the example above, I use a simple form button to start the timer (it also displays the countdown in the status bar). You could also start the timer (that is, run the InitializeTimer() function) automatically by adding the following to the <BODY> tag:

onLoad="InitializeTimer()"

2010/11/15 01:46 2010/11/15 01:46
Posted
Filed under Htm&Javascript

microsoft jquery cdn

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>


<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script>

2010/11/15 01:16 2010/11/15 01:16
Posted
Filed under Htm&Javascript
function CheckValidUrl(strUrl)
{
        var RegexUrl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
        return RegexUrl.test(strUrl);
}
2010/11/08 02:52 2010/11/08 02:52
Posted
Filed under Htm&Javascript
function trim(str) {
 return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
String.prototype.trim = function() {
    return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
2010/11/08 02:51 2010/11/08 02:51
Posted
Filed under Htm&Javascript
출처  : http://blog.dbza.net/15




function createForm(nm,mt,at,tg) { var f=document.createElement("form"); f.name=nm; f.method=mt; f.action=at; f.target=tg; return f; } function addHidden(f,n,v) { var i=document.createElement("input"); i.type="hidden"; i.name=n; i.value=v; f.insertBefore(i); return f; } var frm=createForm("폼이름", "폼method", "URL", "_self"); frm=addHidden(frm, "폼name", "폼value"); . . . document.insertBefore(frm); frm.submit();
2010/09/30 16:26 2010/09/30 16:26