source

Wordpress Database Class - MySQL 유형 비트

lovecheck 2023. 9. 14. 23:20
반응형

Wordpress Database Class - MySQL 유형 비트

저는 MySQL 데이터베이스와 통신하기 위해 워드프레스 내부의 WPDB 객체를 사용하고 있습니다.내 데이터베이스에 다음과 같은 유형의 열이 있습니다. , 그러나 워드프레스는 이것들을 다음과 같이 추출하지 않습니다.
$(selector).after(..)
$(selector).insertAfter(..)

아니면

(그들은 내 로컬 머신에서 실행했습니다).

질문:.

워드프레스의 데이터베이스 값이 있다면 간단한 비교는 할 수 없습니다.

$(document).ready(function(){
    $('div.app').myPlugin();
});

아니면

$('div').css({
    opacity: .1 // opacity in modern browsers, filter in IE.
});

:

// higher level interfaces (facades) for $.ajax();
$.getJSON();
$.get();
$.getScript();
$.post();

값이 다음과 같은지 확인하려면 어떻게 해야 합니까?

// jQuery utilizes it's own event system implementation on top of DOM events.
$('div').click(function(){})
$('div').trigger('click', function(){})

$.each(function(){});
$('div').each(function(){});

?

$('div').toggle(function(){}, function(){});

배경:

$.proxy(function(){}, obj); // =oP

이것은 로컬 머신의 문제가 아니라 생산에서만 문제가 되었습니다.

$('<div class="hello">world</div>');

다음과 같이 데이터베이스를 쿼리합니다.

// this feels like cheating...
$.fn.plugin = function(){}
$('div').plugin();

내가 할 때는.

// CONFIG is shared
$.fn.plugin = function(CONFIG){
     CONFIG = $.extend({
         content: 'Hello world!'
     }, CONFIG);
     this.html(CONFIG.content);
}
데이터베이스의 결과에 따라 브라우저가 보여주는 출력은 다음과 같습니다.

방법을 주목합니다.

그리고.

$('#someDiv').addClass('green'); // a single DOM element

$('div').addClass('green');      // a collection of DOM elements
줄의 크기를 나타내다

, 연관된 가치는 없습니다이 값은 다음 값으로 채워야 합니다.

기능적 프로그래밍의 관점에서 볼 때, jQuery는 모나드입니다.모나드는 동작에 개체를 전달하고 수정된 개체를 반환하여 다음 동작에 전달하는 구조입니다.조립라인처럼.

위키피디아 기사는 정의를 매우 잘 다루고 있습니다.

언급URL : https://stackoverflow.com/questions/3631039/design-patterns-used-in-the-jquery-library

반응형