5월, 2011의 게시물 표시

jQuery AJAX Methods

Method Description $.ajax() Performs an AJAX request ajaxComplete() Specifies a function to run when the AJAX request completes ajaxError() Specifies a function to run when the AJAX request completes with an error ajaxSend() Specifies a function to run before the AJAX request is sent $.ajaxSetup() Sets the default values for future AJAX requests ajaxStart() Specifies a function to run when the first AJAX request begins ajaxStop() Specifies a function to run when all AJAX requests have completed ajaxSuccess() Specifies a function to run an AJAX request completes successfully $.get() Loads data from a server using an AJAX HTTP GET request $.getJSON() Loads JSON-encoded data from a server using a HTTP GET request $.getScript() Loads (and executes) a JavaScript from the a server using an AJAX HTTP GET request load() Loads data from a server and puts the returned HTML into the selected element $.param() Creates a serialized representation of an array or object (can be used as...

jQuery AJAX Methods

Method Description $.ajax() Performs an AJAX request ajaxComplete() Specifies a function to run when the AJAX request completes ajaxError() Specifies a function to run when the AJAX request completes with an error ajaxSend() Specifies a function to run before the AJAX request is sent $.ajaxSetup() Sets the default values for future AJAX requests ajaxStart() Specifies a function to run when the first AJAX request begins ajaxStop() Specifies a function to run when all AJAX requests have completed ajaxSuccess() Specifies a function to run an AJAX request completes successfully $.get() Loads data from a server using an AJAX HTTP GET request $.getJSON() Loads JSON-encoded data from a server using a HTTP GET request $.getScript() Loads (and executes) a JavaScript from the a server using an AJAX HTTP GET request load() Loads data from a server and puts the returned HTML into the selected element $.param() Creates a serialized representation of an array or object (can be used as...

jQuery Miscellaneous Methods

Method Description data() Attaches data to, or gets data from, selected elements each() Run a function for each element matched by the jQuery selector get() Get the DOM elements matched by the selector index() Search for a given element from among the matched elements $.noConflict() Release jQuery's control of the $ variable $.param() Creates a serialized representation of an array or object (can be used as URL query string for AJAX requests) removeData() Removes a previously-stored piece of data size() Return the number of DOM elements matched by the jQuery selector toArray() Retrieve all the DOM elements contained in the jQuery set, as an array

jQuery Selectors Sample

Selector Example Selects * $("*") All elements # id $("#lastname") The element with id=lastname . class $(".intro") All elements with class="intro" element $("p") All p elements . class . class $(".intro.demo") All elements with the classes "intro" and "demo" :first $("p:first") The first p element :last $("p:last") The last p element :even $("tr:even") All even tr elements :odd $("tr:odd") All odd tr elements :eq( index ) $("ul li:eq(3)") The fourth element in a list (index starts at 0) :gt( no ) $("ul li:gt(3)") List elements with an index greater than 3 :lt( no ) $("ul li:lt(3)") List elements with an index less than 3 :not( selector ) $("input:not(:empty)") All input elements that are not empty :header $(":header") All header elements h1, h2 ... :animated $(":animated") All ani...

jQuery HTML Methods

Method Description addClass() Adds one or more classes (for CSS) to selected elements after() Inserts content after selected elements append() Inserts content at the end of (but still inside) selected elements appendTo() Inserts content at the end of (but still inside) selected elements attr() Sets or returns an attribute and value of selected elements before() Inserts content before selected elements clone() Makes a copy of selected elements detach() Removes (but keeps a copy of) selected elements empty() Removes all child elements and content from selected elements hasClass() Checks if any of the selected elements have a specified class (for CSS) html() Sets or returns the content of selected elements insertAfter() Inserts HTML markup or elements after selected elements insertBefore() Inserts HTML markup or elements before selected elements prepend() Inserts content at the beginning of (but still inside) selected elements prependTo() Inserts content at the beginning o...

jQuery CSS Methods

addClass() Adds one or more classes to selected elements css() Sets or returns one or more style properties for selected elements hasClass() Checks if any of the selected elements have a specified class height() Sets or returns the height of selected elements offset() Sets or returns the position (relative to the document) for selected elements offsetParent() Returns the first parent element that is positioned position() Returns the position (relative to the parent element) of the first selected element removeClass() Removes one or more classes from selected elements scrollLeft() Sets or returns the horizontal position of the scrollbar for the selected elements scrollTop() Sets or returns the vertical position of the scrollbar for the selected elements toggleClass() Toggles between adding/removing one or more classes from selected elements width() Sets or returns the width of selected elements

jQuery AJAX Methods

Method Description $.ajax() Performs an AJAX request ajaxComplete() Specifies a function to run when the AJAX request completes ajaxError() Specifies a function to run when the AJAX request completes with an error ajaxSend() Specifies a function to run before the AJAX request is sent $.ajaxSetup() Sets the default values for future AJAX requests ajaxStart() Specifies a function to run when the first AJAX request begins ajaxStop() Specifies a function to run when all AJAX requests have completed ajaxSuccess() Specifies a function to run an AJAX request completes successfully $.get() Loads data from a server using an AJAX HTTP GET request $.getJSON() Loads JSON-encoded data from a server using a HTTP GET request $.getScript() Loads (and executes) a JavaScript from the a server using an AJAX HTTP GET request load() Loads data from a server and puts the returned HTML into the selected element $.param() Creates a serialized representation of an array or object (can be used as...

jQuery CSS Methods

addClass() Adds one or more classes to selected elements css() Sets or returns one or more style properties for selected elements hasClass() Checks if any of the selected elements have a specified class height() Sets or returns the height of selected elements offset() Sets or returns the position (relative to the document) for selected elements offsetParent() Returns the first parent element that is positioned position() Returns the position (relative to the parent element) of the first selected element removeClass() Removes one or more classes from selected elements scrollLeft() Sets or returns the horizontal position of the scrollbar for the selected elements scrollTop() Sets or returns the vertical position of the scrollbar for the selected elements toggleClass() Toggles between adding/removing one or more classes from selected elements width() Sets or returns the width of selected elements

jQuery HTML Methods

Method Description addClass() Adds one or more classes (for CSS) to selected elements after() Inserts content after selected elements append() Inserts content at the end of (but still inside) selected elements appendTo() Inserts content at the end of (but still inside) selected elements attr() Sets or returns an attribute and value of selected elements before() Inserts content before selected elements clone() Makes a copy of selected elements detach() Removes (but keeps a copy of) selected elements empty() Removes all child elements and content from selected elements hasClass() Checks if any of the selected elements have a specified class (for CSS) html() Sets or returns the content of selected elements insertAfter() Inserts HTML markup or elements after selected elements insertBefore() Inserts HTML markup or elements before selected elements prepend() Inserts content at the beginning of (but still inside) selected elements prependTo() Inserts content at the beginning o...

jQuery Effect Methods

Method Description animate() Performs a custom animation (of a set of CSS properties) for selected elements clearQueue() Removes all queued functions for the selected element delay() Sets a delay for all queued functions for the selected element dequeue() Runs the next queued functions for the selected element fadeIn() Gradually changes the opacity, for selected elements, from hidden to visible fadeOut() Gradually changes the opacity, for selected elements, from visible to hidden fadeTo() Gradually changes the opacity, for selected elements, to a specified opacity hide() Hides selected elements queue() Shows the queued functions for the selected element show() Shows hidden selected elements slideDown() Gradually changes the height, for selected elements, from hidden to visible slideToggle() Toggles between slideUp() and slideDown() for selected elements slideUp() Gradually changes the height, for selected elements, from visible to hidden stop() Stops a running animation ...

jQuery Events

Method Description bind() Add one or more event handlers to matching elements blur() Triggers, or binds a function to the blur event of selected elements change() Triggers, or binds a function to the change event of selected elements click() Triggers, or binds a function to the click event of selected elements dblclick() Triggers, or binds a function to the dblclick event of selected elements delegate() Add one or more event handlers to current, or future, specified child elements of the matching elements die() Remove all event handlers added with the live() function error() Triggers, or binds a function to the error event of selected elements event.currentTarget The current DOM element within the event bubbling phase event.data Contains the optional data passed to jQuery.fn.bind when the current executing handler was bound event.isDefaultPrevented() Returns whether event.preventDefault() was called for the event object event.isImmediatePropagationStopped() Returns wheth...

jQuery Name Conflicts

jQuery uses the $ sign as a shortcut for jQuery. Some other JavaScript libraries also use the dollar sign for their functions. The jQuery noConflict() method specifies a custom name (like jq), instead of using the dollar sign. <script type="text/javascript"> var jq=jQuery.noConflict();   jq (document).ready(function(){        jq ("button").click(function(){       jq ("p").hide();     });   }); </script>

jquery start

The Document Ready Function You might have noticed that all jQuery methods, in our examples, are inside a document.ready() function: $(document).ready(function(){    // jQuery functions go here... }); jquery 의 시작은 $(document).ready(function(){ user  define - functions  }); 이렇게 시작하며 모든 function 들은 user define -function 에 기술하여 사용한다

jquery selector example

jquery selector jquery Element Selectors $(this).hide() Demonstrates the jQuery hide() method, hiding the current HTML element. $("#test").hide() Demonstrates the jQuery hide() method, hiding the element with id="test". $("p").hide() Demonstrates the jQuery hide() method, hiding all <p> elements. $(".test").hide() Demonstrates the jQuery hide() method, hiding all elements with class="test". jquery Attribute Selectors jQuery uses XPath expressions to select elements with given attributes. $("[href]")              select all elements with an href attribute. $("[href='#']")        select all elements with an href value equal to "#". $("[href!='#']")      select all elements with an href attribute NOT equal to "#". $("[href$='.jpg']") select all elements with an href attribute that ends with ".jpg". jQuery CSS Sele...

ajax

beforeSend  is called before the request is sent, and is passed the  XMLHttpRequest object as a parameter. error  is called if the request fails. It is passed the  XMLHttpRequest , a string indicating the error type, and an exception object if applicable. dataFilter  is called on success. It is passed the returned data and the value of dataType , and must return the (possibly altered) data to pass on to  success . success  is called if the request succeeds. It is passed the returned data, a string containing the success code, and the  XMLHttpRequest  object. complete  is called when the request finishes, whether in failure or success. It is passed the  XMLHttpRequest  object, as well as a string containing the success or error code. beforeSend 는 서버로 요청을 보내기전 호출됩니다. error 는 호출에 실패하였을때 호출됩니다. dataFilte r 는 ajax를 호출할때 파라미터로 dataType이라는것을 넘겨주게 되는데 이값을 검사하여 호출됩니다. success 는 서버에서 데이터를 잘 받았을때 호출됩니다. complate 는 성공이나 실패가나...

Java SMTP Mail

import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; import java.io.*; import java.util.*; import java.security.Security; public class SendMail {  public static void main(String[] args)  {   Properties prop = new Properties();   prop.put("mail.smtp.host", "mail.host");   prop.put("mail.smtp.port", "25");   prop.put("mail.smtp.starttls.enable","true");   prop.put("mail.smtp.auth",  "true"); //  prop.put("mail.smtp.debug", "true");       String UserName = "database user id";   String PassWord = "database password";   String type = "text/html; charset=KSC5601";     try    {    Authenticator authenticator = null;     authenticator = new SMTPAuthenticator(UserName, PassWord);        Session session = Session.getInstance(prop, authenticator); //      session.setDebug(true);...

ajax

$.ajax({    url: 'snippet.html',    success: function(data)   {       $('.result').html(data);       alert('Load was performed');    } }); url 'snippet.html' 을 서버에서 불러오며 / success event 가 발생되면 :  function(data) 를 실행한다 function(data) 에는 url:snippet.html 의 값이 들어가 있으며 (html 값으로 저장되어 온다) $('.result).html(data); 는 result class 의 값을 data 값으로 바꾼다 ex) <html> <body>             <p class="result">Result value:</p> <script type="text/javascript"> $.ajax({  url: 'snippet.html',  success: function(data){   $('.result').html(data);   alert('Load was performed');  } }); </script> </body> </html>

jqeury Attribute

(select).addClass(className) ex) $("p").addClass("myClass"); (select).removeClass(className) ex) $("p").removeClasss("ClassName"); (select).attr(attributeName) (select).attr(attributeName, value) (select).removeAttr(attributeName) 이 두함수는 선택된 엘리먼트의 속서값을 가져오거나 설정할 수 있도록 합니다. <!DOCTYPE html> <html> <head> <style>em { color:blue; font-weight;bold; } div { color:red; }</style> <script src="http://code.jquery.com/jquery-latest.min.js"></script> </head> <body> <p> Once there was a <em title="huge, gigantic">large</em> dinosaur... </p> The title of the emphasis is:<div></div> <script>var title = $("em").attr("title"); $("div").text(title); </script> </body> </html> <img id="greatphoto" src="brush-seller.jpg" alt="brush seller" ...

jquery css

(selector).css(name,value) (selector).css({properties}) (selector).css(name)   (select).css(name,value)    이 함수는 선택된 엘리먼트의 name 값을 value로 변경하는 일을 합니다 .  ex) $("p").css("background-color","yellow"  (select).css({properties})   이 함수는 한번에 여러개의 속성을 지정합니다 .  ex) $("p").css({"background-color":"yellow","font-size":"200%"})  (selector).css(name) 이 함수는 name 에 해당하는 스트일 값을 가져 옵니다.

jquery selector

http://w3schools.com/jquery/jquery_ref_html.asp addClass()   Adds one or more classes (for CSS) to selected elements after()  Inserts content after selected elements append()   Inserts content at the end of (but still inside) selected elements appendTo()   Inserts content at the end of (but still inside) selected elements attr()  Sets or returns an attribute and value of selected elements before()  Inserts content before selected elements clone()   Makes a copy of selected elements detach()  Removes (but keeps a copy of) selected elements empty()   Removes all child elements and content from selected elements hasClass()  Checks if any of the selected elements have a specified class (for CSS) html()  Sets or returns the content of selected elements insertAfter() Inserts HTML markup or elements after selected elements insertBefore() Inserts HTML markup or elements before selected elements prepend() Inserts content at t...

Weblogic & SpringFramework

Spring Application을 WebLogic 10.X 버전에 배포할 때, 10.X 버전의 경우 기본적으로 Spring Framework가 탑재가 되어 있어 문제가 된다. WebLogic 자체에 Spring Framework가 탑재되어 있는데 2.0.X 버전을 사용하고 있기 때문에 배포하는 Spring Appplication이 2.5.X, 나 3.0.X 기반이라면 웹로직의 클래스 로더의 클래스 로딩 정책에 의해 배포하는 Application의 Spring이 로딩이 안된다. 이를 해결하기 위해서는 WebLogic의 설정에서 웹 어플리케이션에서 사용하는 라이브러리를 우선적으로 로딩할 수 있는 옵션을 주어야 한다. WEB-INF/weblogic.xml 파일에 아래와 같이 설정을 추가하면 된다. <prefer-web-inf-classes>true</prefer-web-inf-classes> 이렇게 하면 WebLogic이 어플리케이션을 로딩할때 WEB-INF/lib 에 있는 라이브러리들을 우선적으로 참조하게 된다.

JavaScript 총정리 - 펌

######################### 개체(Object) : 개체라는 말은 상당히 추상적이다. 이 개념을 알려면 "객체지향"을 공부해야 한다. 이 과에서 의미한 개체는 HTML 문서, 브라우저 윈도우 , 날짜/시간과 같은 것을 의미하며 일반적으로 개체는 그 개체가 할 수 있는 일을 정의한 메소드와 그 개체의 특징을 나타내는 속성으로 구성된다. ### date : Date는 시스템의 날짜와 시간을 얻기 위한 개체이다. 이 개체를 생성하는 방법은 다음과 같다 : Nameofobject = new Date(); ### document : 이것은 해당 자바스크립트를 포함하고 있는 HTML 문서를 참조할 수 있는 개체를 의미한다. ### location : Location은 특정 URL을 지징하는 개체이다. 다음과 같은 형식으로 사용된다: parent.location!='index.html' (location이란 속성도 있는데 사용법이 서로 틀리다는 것을 기억하기 바란다.) ### window : window는 브라우저 화면을 참조할 수 있는 개체이다. ######################### 메소드(Method) : 메소드는 어떤 개체로 하여금 어떻게 행동할지를 알려주는 하나의 명령을 의미한다. alert!() : alert!는 window 개체 또는 하이퍼텍스트 링크내에서 대화 상자를 만들기 위해 사용되는 메소드이다. alert!문의 괄호 안에 있는 텍스트를 대화 상자에 보여주고 OK 버튼이 함께 제공되며 사용자가 계속 진행하기 위해서는 이 버튼을 눌러야만 한다. getMonth() : Date 개체의 메소드로 현재 월을 0~11 사이의 숫자로 반환한다. getDate() : Date 개체의 메소드로 현재 날짜를 1~31 사이의 숫자로 반환한다. getYear() : Date 개체의 메소드로 현재 연도를 0~99 사이의 숫자로 반환한다. (인터넷 익스플로러 5 이상...