jQuery ajaxForm plugin (form submit)

JAVASCRIPT 2013. 6. 17. 17:18 Posted by Dayis

Plugin : http://jquery.malsup.com/form/#download

사용 예 : http://mytory.net/archives/223


$(function(){ $('#FormID').ajaxSubmit(); });


$(function(){ $('#FormID').ajaxSubmit({ success: function(msg){ alert(msg); } }); });


※ ajaxForm과 ajaxSubmit

ajaxForm : 실제 submit이 일어나기 전의 이벤트 리스너..??

ajaxSubmit : 실제 submit

'JAVASCRIPT' 카테고리의 다른 글

[jQuery] window와 document 비교  (0) 2013.07.09
날씨 API  (0) 2013.07.03
jQuery 모바일 터치슬라이드  (0) 2013.05.29
jQuery 특정영역(div)만 출력  (0) 2013.05.13
jQuery 엔터키 이벤트  (0) 2013.05.13

jQuery 모바일 터치슬라이드

JAVASCRIPT 2013. 5. 29. 15:50 Posted by Dayis

jQuery 모바일 터치슬라이드


https://github.com/lusever/TouchSlider


http://touchslider.com/

'JAVASCRIPT' 카테고리의 다른 글

날씨 API  (0) 2013.07.03
jQuery ajaxForm plugin (form submit)  (0) 2013.06.17
jQuery 특정영역(div)만 출력  (0) 2013.05.13
jQuery 엔터키 이벤트  (0) 2013.05.13
jQuery 숫자 포멧 변경 (콤마..)  (0) 2013.05.06

jQuery 특정영역(div)만 출력

JAVASCRIPT 2013. 5. 13. 18:29 Posted by Dayis


jquery.printArea.js

<html>

<head>

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

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

<script>

$(document).ready(function() {

   //////////

   // PrintArea

   ///////////

   $("#printButton").click(function(){

      $("#printable").printArea();

   });

});


</script>

</head>

<body>

<p><b>Example 5: PrintArea - Only the actual table will print, not the titles</b>

<p>An advertisement that you don't want printed out.

<p>Another advertisement that you don't want printed out.

<div id=printable>

<table width=40% cellpadding=3 cellspacing=0 border=1>

<tr><th>Name</th><th>Age</th><th>Height</th></tr>

<tr><td>John Q</td><td>23</td><td>6'1"</td></tr>

<tr><td>Jane Q</td><td>23</td><td>5'1"</td></tr>

<tr><td>Jimmy R</td><td>23</td><td>5'6"</td></tr>

<tr><td>Jamie W</td><td>23</td><td>5'9"</td></tr>

</table>

</div>

<p><input type=button id=printButton value="Print">

<p>All the annoying disclaimer text you don't want printed out.

</body>

</html>

'JAVASCRIPT' 카테고리의 다른 글

jQuery ajaxForm plugin (form submit)  (0) 2013.06.17
jQuery 모바일 터치슬라이드  (0) 2013.05.29
jQuery 엔터키 이벤트  (0) 2013.05.13
jQuery 숫자 포멧 변경 (콤마..)  (0) 2013.05.06
URL 정보 확인  (0) 2013.04.11

jQuery 엔터키 이벤트

JAVASCRIPT 2013. 5. 13. 07:02 Posted by Dayis

$('#pwd').live('keypress', function(e) {

if (e.which == 13) {/* 13 == enter key@ascii */

formCheck();

}

});

'JAVASCRIPT' 카테고리의 다른 글

jQuery 모바일 터치슬라이드  (0) 2013.05.29
jQuery 특정영역(div)만 출력  (0) 2013.05.13
jQuery 숫자 포멧 변경 (콤마..)  (0) 2013.05.06
URL 정보 확인  (0) 2013.04.11
숫자만 입력가능  (0) 2013.04.03

jQuery 숫자 포멧 변경 (콤마..)

JAVASCRIPT 2013. 5. 6. 12:07 Posted by Dayis

Easily format numbers for display use. Replace numbers inline in a document, or return a formatted number for other uses.


https://github.com/teamdf/jquery-number.git

'JAVASCRIPT' 카테고리의 다른 글

jQuery 특정영역(div)만 출력  (0) 2013.05.13
jQuery 엔터키 이벤트  (0) 2013.05.13
URL 정보 확인  (0) 2013.04.11
숫자만 입력가능  (0) 2013.04.03
[jQueryMobile] data-role="content" 높이 100%로 채우기  (0) 2012.11.13

ASP 입력값 Replace (따옴표, 작은따옴표..)

ASP 2013. 5. 1. 15:22 Posted by Dayis

function checkword(checkvalue)

  checkvalue = replace(checkvalue, "&", "&#38;")

  checkvalue = replace(checkvalue, """", "&#34;")

  checkvalue = replace(checkvalue, "'", "&#39;")

  checkvalue = replace(checkvalue, chr(13),"<br>"+chr(13))

  checkword = checkvalue

end function

'ASP' 카테고리의 다른 글

ASP utf-8  (0) 2014.12.17
ASP 프레임워크(Framework)  (0) 2014.12.05
ASP 파라메터 컨트롤 함수  (0) 2012.01.09
jquery 파일 업로드  (0) 2010.12.10
구글맵  (0) 2010.12.09

테이블 스키마를 dbo로 변경

MS-SQL 2013. 4. 14. 00:10 Posted by Dayis

mssql 2005 이전 버전
exec sp_changeobjectowner '유저명.objects명(테이블 또는 프로시져)','dbo'

mssql 2005
alter schema dbo transfer 유저명.objects명(테이블 또는 프로시져)

예)
snjgame이 소유한 aaa테이블, bbb프로시져

mssql 2005이전

exec sp_changeobjectowner 'snjgame.aaa','dbo'
exec sp_changeobjectowner 'snjgame.bbb','dbo'

mssql 2005

alter schema dbo transfer SagoAdmin.UP_NT_SAGO_CHARGEINFO_CANCEL;

'MS-SQL' 카테고리의 다른 글

중복 데이터 삭제  (0) 2014.03.03
전체 테이블의 모든 인덱스 조회  (0) 2013.01.03
MS-SQL 인덱스 조각모음  (0) 2013.01.03
MS-SQL 전체 테이블 크기 조회 (용량순, 테이블이름순)  (0) 2012.08.16
declare cursor  (0) 2012.06.12

URL 정보 확인

JAVASCRIPT 2013. 4. 11. 17:17 Posted by Dayis

<html>

<head>

<script type="text/javascript">

window.onload = function () {

 var hostname = window.location.hostname; 

 var href = window.location.href; 

 var host = window.location.host; 

 var port = window.location.port; 

 var pathname = window.location.pathname; 

 var search = window.location.search; 

 var protocoal = window.location.protocol;

 var _str = "hostname:" + hostname + "<br>";

 _str += "href:" + href + "<br>";

 _str += "host:" + host + "<br>";

 _str += "port:" + port + "<br>";

 _str += "pathname:" + pathname + "<br>";

 _str += "search:" + search + "<br>";

 _str += "protocoal:" + protocoal + "<br>";

 

 var hostname = window.location.hostname; 

 var _host;

 if (hostname.indexOf(".") > 0) {

  _host = hostname.split(".")[0];

 } else {

  _host = hostname;

 }

 document.getElementById("tmpDiv").innerHTML = "host:" + _host + "<hr>" + _str;

}

</script>

</head>

<body>

 <div id="tmpDiv" name="tmpDiv">

 </div>

</body>

</html>

숫자만 입력가능

JAVASCRIPT 2013. 4. 3. 00:18 Posted by Dayis

.....................................................................................................................................................................................................................................................

function onlyNumber(event) {
    var key = window.event ? event.keyCode : event.which;    

    if ((event.shiftKey == false) && ((key  > 47 && key  < 58) || (key  > 95 && key  < 106)
    || key  == 35 || key  == 36 || key  == 37 || key  == 39  // 방향키 좌우,home,end  
    || key  == 8  || key  == 46 ) // del, back space
    ) {
        return true;
    }else {
        return false;
    }    
};


호출하는 부분은 아래와 같다

<input type="text" name="test" value="test" style="ime-mode:disabled;" onkeydown="return onlyNumber(event)">


테스트해볼수 있는 곳


http://jsfiddle.net/cJSkd/4/

전체 테이블의 모든 인덱스 조회

MS-SQL 2013. 1. 3. 15:14 Posted by Dayis

Declare @TblName sysname, @ObjId int, @IndexName sysname, @IndexId int, @GroupId int

, @ignore_dup_key bit, @is_unique bit, @is_hypothetical bit, @is_primary_key bit, @is_unique_key bit

, @keys nvarchar(2126), @groupname sysname


declare TblObjects cursor local static for

Select objects.object_Id, objects.Name, Indexes.Name, index_id, data_space_id

, ignore_dup_key, is_unique, is_hypothetical, is_primary_key, is_unique_constraint

From sys.objects As objects

Inner Join sys.indexes As Indexes On objects.object_Id=Indexes.object_Id

Where objects.Type='U'

open TblObjects


fetch TblObjects into @ObjId, @TblName, @IndexName, @IndexId, @GroupId, 

@ignore_dup_key, @is_unique, @is_hypothetical, @is_primary_key, @is_unique_key


Create Table #Index

(

tblName sysname

, indexName sysname null

, IndexId int

, ignore_dup_key bit

, is_unique bit

, is_hypothetical bit

, is_primary_key bit

, is_unique_key bit

, groupname sysname collate database_default NULL

, indexKeys nvarchar(2126)

)


while @@fetch_status >= 0

begin

declare @i int, @thiskey nvarchar(131) 


select @keys = index_col(@TblName, @IndexId, 1), @i = 2

if (indexkey_property(@objid, @IndexId, 1, 'isdescending') = 1)

select @keys = @keys  + '(-)'


select @thiskey = index_col(@TblName, @IndexId, @i)

if ((@thiskey is not null) and (indexkey_property(@objid, @IndexId, @i, 'isdescending') = 1))

select @thiskey = @thiskey + '(-)'


while (@thiskey is not null )

begin

select @keys = @keys + ', ' + @thiskey, @i = @i + 1

select @thiskey = index_col(@TblName, @IndexId, @i)

if ((@thiskey is not null) and (indexkey_property(@objid, @IndexId, @i, 'isdescending') = 1))

select @thiskey = @thiskey + '(-)'

end

select @groupname = null

select @groupname = name from sys.data_spaces where data_space_id = @groupid

-- INSERT ROW FOR INDEX

insert into #Index values (@TblName, @IndexName, @IndexId

, @ignore_dup_key, @is_unique, @is_hypothetical, @is_primary_key, @is_unique_key

, @groupname, @keys)


-- Next index

fetch TblObjects into @ObjId, @TblName, @IndexName, @IndexId, @GroupId, 

@ignore_dup_key, @is_unique, @is_hypothetical, @is_primary_key, @is_unique_key


end

deallocate TblObjects

select

tblName,

indexName,

indexKeys,

PK=case when is_primary_key <>0 then 'PK' else 'IX' end,

UniqueYN=case when is_unique <>0 then 'Y' else 'N' end,

'index_description' = convert(varchar(210), --bits 16 off, 1, 2, 16777216 on, located on group

case when IndexId = 1 then 'clustered' else 'nonclustered' end

+ case when ignore_dup_key <>0 then ', ignore duplicate keys' else '' end

+ case when is_unique <>0 then ', unique' else '' end

+ case when is_hypothetical <>0 then ', hypothetical' else '' end

+ case when is_primary_key <>0 then ', primary key' else '' end

+ case when is_unique_key <>0 then ', unique key' else '' end

+ ' located on ' + groupname)

from #Index

order by tblName, IndexId, indexName


Drop Table #Index

'MS-SQL' 카테고리의 다른 글

중복 데이터 삭제  (0) 2014.03.03
테이블 스키마를 dbo로 변경  (0) 2013.04.14
MS-SQL 인덱스 조각모음  (0) 2013.01.03
MS-SQL 전체 테이블 크기 조회 (용량순, 테이블이름순)  (0) 2012.08.16
declare cursor  (0) 2012.06.12