├── chapter-7 ├── Korean.png ├── flags.png ├── Chinese.png ├── English.png ├── Japanese.png ├── loading.gif ├── large_image.jpg ├── my_important_image.jpg ├── not_important_image.jpg ├── sleep.js ├── 7-316_script_at_bottom.html ├── 7-312_script_in_head.html ├── 7-352_separated_flags.html ├── 7-353_image_sprite.html ├── 7-320_img_lazy_load.html ├── 7-317_script_lazy_load.html └── 7-323_img_lazy_load_background.html ├── chapter-6 ├── notice_list.json ├── 6-297_dom_reflow_inside_loop.js ├── 6-297_inefficient_dom_reflow.js ├── 6-304_web_worker.html ├── worker.js ├── 6-269_nesting_level_test.html ├── 6-307_shared_workder.html ├── sharedWorker.js ├── 6-266_requestanimationframe_shim.js ├── 6-279_position_relative_absolute.html ├── 6-249_settimeout_2_seconds.html ├── 6-272_dom_repaint.html ├── 6-300_memoization_dom_search.html ├── 6-275_dom_reflow.html ├── 6-252_same_settimeout.html ├── 6-301_cache_dom_variable.html ├── 6-255_setinterval_thread_queue.html ├── 6-295_change_background.html ├── 6-293_changing_display.html ├── 6-290_dom_clone.html ├── 6-281_reflow_minimized_notice.html ├── 6-258_clock_with_setinterval.html ├── 6-286_documentfragment.html └── 6-261_setinterval_time_difference.html ├── chapter-4 ├── 4-146_original_object_create.js ├── 4-114_new_with_function.html ├── 4-115_new_with_class.html ├── 4-155_object_create_shim.js ├── 4-147_object_create_inheritance.html ├── 4-149_object_create_initialize.html ├── 4-135_avoiding_prototype.html ├── 4-116_calling_function.html ├── 4-140_prototype_inheritance.html ├── 4-140_object_inheritance.html ├── 4-154_class_extends.html ├── 4-153_object_create_with_new.html ├── 4-114_new_with_java.java ├── 4-150_object_create_configure.html ├── 4-139_early_inheritance.html ├── 4-118_this.html ├── 4-133_printing_all_properties.html ├── 4-132_prototype_chain.html ├── 4-148_object_create_object.html ├── 4-130_circular_reference.html ├── 4-151_accessor.html └── 4-124_prototype.html ├── chapter-2 ├── 2-26_testing_function_scope.html ├── 2-39_obscure_with.html ├── 2-27_testing_with_scope.html ├── 2-26_testing_catch_scope.html ├── 2-40_alternative_style_settings.html ├── 2-41_closer_example.html ├── 2-25_testing_block_scope.html ├── 2-45_closer_easy_example.html ├── 2-22_scope_issue.html ├── 2-35_understanding_with.html ├── 2-28_resolve_with_with.html ├── 2-32_resolve_with_IIFE.html ├── 2-42_closer_example.html ├── 2-31_resolve_with_function.html ├── 2-37_using_with.html ├── 2-44_static_with_closer.html ├── 2-49_setInterval_closer.html └── 2-51_closer_practical_example.html ├── chapter-3 ├── 3-84_how_to_use_global.html ├── 3-80_access_global_through_window.html ├── 3-76_global_variables.html ├── 3-69_add_function_prototype.html ├── 3-83_access_global_function.html ├── 3-96_checking_uninitialized.html ├── 3-83_set_global_function.html ├── 3-69_global_variable.html ├── 3-72_xhr2.js ├── 3-81_accessing_global.html ├── 3-66_how_to_generate_a_string.html ├── 3-77_issue_from_global.html ├── 3-61_branch_variable_type.html ├── 3-63_create_object_with_new.html ├── 3-68_additional_property_on_strings.html ├── 3-91_var_inside_if.html ├── 3-93_collecting_var_definitions.html ├── 3-86_var_vs_no_var.html ├── 3-72_xhr1.js ├── 3-70_global_event_handler.html ├── 3-97_no_var_mistake.html ├── 3-78_variable_without_var.html ├── 3-84_redefining_window.html ├── 3-67_difference_between_strings.html ├── 3-99_collecting_var_minification.html ├── 3-98_multiple_var_minification.html ├── 3-100_avoiding_global.js ├── 3-70_global_xmlhttprequest.html ├── 3-74_async_request_issue.html ├── 3-64_instanceof_primitive_type.html ├── 3-102_javascript_inside_html.html ├── 3-103_split_javascript_and_html.html ├── 3-94_multiple_vars.html ├── 3-94_collecting_vars.html ├── 3-105_scope_chain.html ├── 3-82_how_to_loop_global.html ├── 3-110_set_style_variable.html ├── 3-108_shifting_scope_chain_to_local.html └── 3-73_local_with_closer.html ├── chapter-9 ├── 9-416_app.js ├── 9-400_destructuring_default_value.html ├── 9-384_let_const.js ├── 9-387_arrow_expression_context.js ├── 9-423_exponential.html ├── 9-420_promise.html ├── 9-413_binary_octal.html ├── 9-404_function_parameter_default.html ├── module.js ├── 9-408_yield_examples.html ├── 9-386_arrow_expression.js ├── 9-395_template_string_expression.html ├── 9-397_template_string_expression_analyze.html ├── 9-411_map_set.html ├── 9-412_weakmap_weakset.html ├── 9-385_let_and_var.js ├── 9-403_function_parameter.html ├── 9-406_yield.html ├── 9-417_proxy.html ├── 9-422_array_includes.html ├── 9-388_class.js ├── 9-405_fibonacci_for_of.html ├── 9-407_iterator.html ├── 9-418_symbol.html ├── 9-396_template_string_expression_multiline.html ├── 9-420_promise_flow_control.html ├── 9-409_iterator_flow_control.html ├── 9-415_typed_array.js ├── 9-401_destructuring_example.html ├── 9-399_destructuring.html └── 9-390_object_expression.html ├── README.md ├── chapter-5 ├── 5-240_adder_with_currying.html ├── 5-164_generating_module.js ├── 5-236_self_invoking_constructor.html ├── 5-221_compatibility_for_xmlhttprequest.html ├── 5-162_simple_module.html ├── 5-215_check_ie_version.html ├── 5-179_setting_listener_separately.js ├── 5-222_compatibility_with_init_time_branching.html ├── 5-241_adding_currying_function_prototype.html ├── 5-237_callback_pattern.html ├── 5-224_xmlhttprequest_with_self_defining_function.html ├── 5-180_setting_listener_delegate.js ├── 5-200_backup_wrapped_function_with_proxy.html ├── 5-220_compatibility_for_standard.html ├── 5-230_cache_with_memoization.html ├── 5-197_wrapper_with_proxy.html ├── 5-227_prevent_duplicate_request.html ├── 5-219_compatibility_with_function.html ├── 5-242_unit_translate_with_currying.html ├── 5-243_xmlhttprequest_currying.html ├── 5-202_log_with_proxy.html ├── 5-232_fibbonacci_wth_memoization.html ├── 5-229_adding_cache.html ├── 5-199_same_name_wrapper_with_proxy.html ├── 5-217_compatibility_with_browser.html ├── 5-233_memoization_with_function_prototype.html ├── 5-181_event_delegate_with_id.html ├── 5-187_proxy_with_event_delegation.html ├── 5-184_event_delegate_test_bubbling.html ├── 5-194_aggregating_requests_with_proxy.html ├── 5-225_initialization_with_self_defining_function.html ├── 5-212_decorator_with_proxy_for_monitoring.html ├── 5-208_decorator_for_object.html ├── 5-188_data_collection_with_proxy.html ├── 5-191_cache_with_proxy.html ├── 5-204_form_validate_decorator.html ├── 5-168_event_bubbling_capturing.html └── 5-174_modify_dom_propagation_path.html └── chapter-8 ├── 8-365_open_bracket_newline.html └── 8-379_makefile /chapter-7/Korean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/Korean.png -------------------------------------------------------------------------------- /chapter-7/flags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/flags.png -------------------------------------------------------------------------------- /chapter-7/Chinese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/Chinese.png -------------------------------------------------------------------------------- /chapter-7/English.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/English.png -------------------------------------------------------------------------------- /chapter-7/Japanese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/Japanese.png -------------------------------------------------------------------------------- /chapter-7/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/loading.gif -------------------------------------------------------------------------------- /chapter-7/large_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/large_image.jpg -------------------------------------------------------------------------------- /chapter-7/my_important_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/my_important_image.jpg -------------------------------------------------------------------------------- /chapter-7/not_important_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unikys/javascript_in_depth/HEAD/chapter-7/not_important_image.jpg -------------------------------------------------------------------------------- /chapter-6/notice_list.json: -------------------------------------------------------------------------------- 1 | ["Link to the first article", "Link to the second article", "Link to the third article", "Link to the last article"] 2 | -------------------------------------------------------------------------------- /chapter-4/4-146_original_object_create.js: -------------------------------------------------------------------------------- 1 | 2 | Object.create = function (o) { 3 | function F() {} 4 | F.prototype = o; 5 | return new F(); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /chapter-2/2-26_testing_function_scope.html: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /chapter-3/3-84_how_to_use_global.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /chapter-3/3-80_access_global_through_window.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /chapter-3/3-76_global_variables.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /chapter-9/9-416_app.js: -------------------------------------------------------------------------------- 1 | import getURL, * from "module.js" 2 | getJSON("/getJSON", function (json) { 3 | console.log(json); 4 | }); 5 | getURL("/getURL", function (data) { 6 | console.log(data); 7 | }); 8 | 9 | -------------------------------------------------------------------------------- /chapter-3/3-69_add_function_prototype.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /chapter-3/3-83_access_global_function.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /chapter-3/3-96_checking_uninitialized.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /chapter-9/9-400_destructuring_default_value.html: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /chapter-6/6-297_dom_reflow_inside_loop.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var i, 4 | tags = document.getElementByTagName("div"), 5 | length = tags.length; 6 | 7 | for (i = 0 ; i < length ; i++) { 8 | console.log(tags[i].offsetWidth + " , " tags[i].clientHeight); 9 | } 10 | -------------------------------------------------------------------------------- /chapter-7/sleep.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | sleep(5000); 3 | 4 | function sleep(waitMilliseconds) { 5 | var waitUntil = Date.now() + waitMilliseconds; 6 | while(Date.now() < waitUntil) { 7 | ; 8 | } 9 | } 10 | }()); 11 | -------------------------------------------------------------------------------- /chapter-3/3-83_set_global_function.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter-4/4-114_new_with_function.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /chapter-9/9-384_let_const.js: -------------------------------------------------------------------------------- 1 | let myObject = { 2 | name: "unikys", 3 | say() { 4 | alert("My name is " + this.name); 5 | } 6 | }; 7 | 8 | myObject.say(); 9 | const constString = "This is a constant"; 10 | constString = "This will raise an error"; // Error! 11 | 12 | -------------------------------------------------------------------------------- /chapter-2/2-39_obscure_with.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /chapter-4/4-115_new_with_class.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /chapter-3/3-69_global_variable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /chapter-2/2-27_testing_with_scope.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # javascript_in_depth 2 | 속깊은 자바스크립트 예제 소스 3 |
4 |
5 | * 1장 웹과 자바스크립트 6 | * 2장 자바스크립트의 스코프와 클로저 7 | * 3장 자바스크립트의 변수 8 | * 4장 프로토타입과 객체지향, 그리고 상속 9 | * 5장 디자인 패턴 실용 10 | * 6장 브라우저 환경에서의 자바스크립트 11 | * 7장 자바스크립트 성능과 사용자 경험 개선 12 | * 8장 자바스크립트 코딩과 개발 환경 13 | * 9장 자바스크립트 표준 14 | * 10장 자바스크립트 프레임워크 15 | -------------------------------------------------------------------------------- /chapter-7/7-316_script_at_bottom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
I need to show this important information as fast as possible
6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /chapter-3/3-72_xhr2.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | xhr = new XMLHttpRequest(); 3 | xhr.open("GET", "http://unikys.tistory.com/api"); 4 | xhr.onreadystatechange = function () { 5 | if (xhr.readyState === 4 && xhr.status === 200) { 6 | console.log(xhr.responseText); 7 | } 8 | }; 9 | }()); 10 | -------------------------------------------------------------------------------- /chapter-9/9-387_arrow_expression_context.js: -------------------------------------------------------------------------------- 1 | 2 | var name = "Global"; function Person() { 3 | this.name = "Unikys" 4 | setTimeout(() => alert("My name is " + this.name), 100); 5 | setTimeout(function () { 6 | alert("Global name is " + this.name); 7 | }, 100); 8 | } 9 | var person = new Person(); 10 | -------------------------------------------------------------------------------- /chapter-3/3-81_accessing_global.html: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /chapter-4/4-155_object_create_shim.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | if (!Object.create) { 3 | Object.create = (function () { 4 | function F() {} 5 | return function (o) { 6 | F.prototype = o; 7 | return new F(); 8 | } 9 | }()); 10 | } 11 | }()); 12 | -------------------------------------------------------------------------------- /chapter-2/2-26_testing_catch_scope.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /chapter-2/2-40_alternative_style_settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Alternative style settings
4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /chapter-3/3-66_how_to_generate_a_string.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /chapter-3/3-77_issue_from_global.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /chapter-2/2-41_closer_example.html: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /chapter-3/3-61_branch_variable_type.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /chapter-9/9-423_exponential.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /chapter-6/6-297_inefficient_dom_reflow.js: -------------------------------------------------------------------------------- 1 |
This div will be increased 2 |
3 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /chapter-3/3-63_create_object_with_new.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /chapter-7/7-312_script_in_head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This title will not show during the sleep 6 | 7 | 8 | 9 |
I need to show this important information as fast as possible
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /chapter-9/9-420_promise.html: -------------------------------------------------------------------------------- 1 | 15 | 16 | -------------------------------------------------------------------------------- /chapter-9/9-413_binary_octal.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /chapter-3/3-68_additional_property_on_strings.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /chapter-3/3-91_var_inside_if.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /chapter-3/3-93_collecting_var_definitions.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /chapter-2/2-25_testing_block_scope.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /chapter-2/2-45_closer_easy_example.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /chapter-5/5-240_adder_with_currying.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter-3/3-86_var_vs_no_var.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /chapter-3/3-72_xhr1.js: -------------------------------------------------------------------------------- 1 | var element = document.getElementById("div"), 2 | button = document.getElementById("button"), 3 | 4 | xhr = new XMLHttpRequest(); 5 | button.onclick = function () { 6 | xhr.open("GET", "http://unikys.tistory.com/"); 7 | xhr.onreadystatechange = function () { 8 | if (xhr.readyState === 4 && xhr.status === 200) { 9 | element.innerHTML = xhr.responseText; 10 | } 11 | }; 12 | xhr.send(); 13 | }; 14 | -------------------------------------------------------------------------------- /chapter-5/5-164_generating_module.js: -------------------------------------------------------------------------------- 1 | 2 | (function (windows, undefined) { 3 | 4 | var _myLibrary = window.myLibrary; 5 | 6 | if (!_myLibrary) { 7 | _myLibrary = {}; 8 | } 9 | if (!_myLibrary.unikys) { 10 | _myLibrary.unikys = {}; 11 | } 12 | 13 | _myLibrary.unikys.sayHello = function () { 14 | alert("Hello, my name is Unikys"); 15 | }; 16 | 17 | window.myLibrary = _myLibrary; 18 | 19 | }(window)); 20 | 21 | -------------------------------------------------------------------------------- /chapter-4/4-147_object_create_inheritance.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /chapter-3/3-70_global_event_handler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Global event handler example
4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /chapter-4/4-149_object_create_initialize.html: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /chapter-7/7-352_separated_flags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | Korean 13 | English 14 | Chinese 15 | Japanese 16 | 17 | 18 | -------------------------------------------------------------------------------- /chapter-3/3-97_no_var_mistake.html: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /chapter-5/5-236_self_invoking_constructor.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter-2/2-22_scope_issue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Click me! DIV 0
4 |
Click me! DIV 1
5 |
Click me! DIV 2
6 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /chapter-3/3-78_variable_without_var.html: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /chapter-9/9-404_function_parameter_default.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter-3/3-84_redefining_window.html: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /chapter-9/module.js: -------------------------------------------------------------------------------- 1 | export function getJSON(url, callback) { 2 | var xhr = new XMLHttpRequest(); 3 | xhr.open("GET", url, true); 4 | xhr.onload = function () { 5 | callback(JSON.parse(this.responseText)); 6 | }; 7 | xhr.send(); 8 | } 9 | 10 | export default function (url, callback) { 11 | var xhr = new XMLHttpRequest(); 12 | xhr.open("GET", url, true); 13 | xhr.onload = function () { 14 | callback(this.responseText); 15 | }; 16 | xhr.send(); 17 | } 18 | -------------------------------------------------------------------------------- /chapter-2/2-35_understanding_with.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /chapter-4/4-135_avoiding_prototype.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /chapter-4/4-116_calling_function.html: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /chapter-4/4-140_prototype_inheritance.html: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /chapter-5/5-221_compatibility_for_xmlhttprequest.html: -------------------------------------------------------------------------------- 1 | 2 | 18 | -------------------------------------------------------------------------------- /chapter-9/9-408_yield_examples.html: -------------------------------------------------------------------------------- 1 | 20 | 21 | -------------------------------------------------------------------------------- /chapter-4/4-140_object_inheritance.html: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /chapter-4/4-154_class_extends.html: -------------------------------------------------------------------------------- 1 | 22 | -------------------------------------------------------------------------------- /chapter-5/5-162_simple_module.html: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /chapter-2/2-28_resolve_with_with.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Click me! DIV 0
4 |
Click me! DIV 1
5 |
Click me! DIV 2
6 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /chapter-9/9-386_arrow_expression.js: -------------------------------------------------------------------------------- 1 | let myFunc = () => alert("This is a new function literal"); 2 | myFunc(); 3 | 4 | var myFuncES5 = function () { 5 | alert("This is a new function literal"); 6 | }; 7 | myFuncES5(); 8 | 9 | 10 | 11 | let paramFunc = (greetings, name) => { 12 | alert(greetings + " , " + name); 13 | } 14 | paramFunc("Hello", "World"); 15 | 16 | 17 | var paramFuncES5 = function (greetings, name) { 18 | alert(greetings + " , " + name); 19 | } 20 | paramFuncES5("Hello", "World"); 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /chapter-9/9-395_template_string_expression.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Name: 5 |
6 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /chapter-2/2-32_resolve_with_IIFE.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Click me! DIV 0
4 |
Click me! DIV 1
5 |
Click me! DIV 2
6 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /chapter-4/4-153_object_create_with_new.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | -------------------------------------------------------------------------------- /chapter-9/9-397_template_string_expression_analyze.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /chapter-3/3-67_difference_between_strings.html: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /chapter-4/4-114_new_with_java.java: -------------------------------------------------------------------------------- 1 | class Person { String name; String blog; 2 | public Person(String name, String blog) { 3 | this.name = name; 4 | this.blog = blog; 5 | } 6 | 7 | public String getName(String name) { 8 | this.name = name; 9 | } 10 | public String getBlog(String blog) { 11 | this.blog = blog; 12 | } 13 | 14 | public void main(String [] args) { 15 | Person unikys = new Person("unikys", "unikys.tistory.com"); 16 | System.out.println(unikys.getName()); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter-2/2-42_closer_example.html: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /chapter-9/9-411_map_set.html: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /chapter-9/9-412_weakmap_weakset.html: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /chapter-4/4-150_object_create_configure.html: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /chapter-2/2-31_resolve_with_function.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Click me! DIV 0
4 |
Click me! DIV 1
5 |
Click me! DIV 2
6 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /chapter-9/9-385_let_and_var.js: -------------------------------------------------------------------------------- 1 | if (true) { 2 | var varVariable = 1; 3 | let letVariable = 2; 4 | } 5 | 6 | console.log(varVariable); // === 1 7 | console.log(letVariable); // Uncaught Reference Error 8 | 9 | let myArray = [0,1,2,3,4,5], 10 | length = myArray.length; 11 | 12 | for (let i = 0 ; i < length ; i++) { 13 | if (myArray[i] > 3) { 14 | break; 15 | } 16 | } 17 | console.log(myArray[i]); 18 | 19 | 20 | var duplicatedName = "This is with var"; 21 | var duplicatedName = "No problem"; 22 | let duplicatedName = "Syntax error will be raised"; // Error 23 | 24 | -------------------------------------------------------------------------------- /chapter-9/9-403_function_parameter.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | -------------------------------------------------------------------------------- /chapter-9/9-406_yield.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /chapter-5/5-215_check_ie_version.html: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /chapter-7/7-353_image_sprite.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | Korean 23 | English 24 | Chinese 25 | Japanese 26 | 27 | 28 | -------------------------------------------------------------------------------- /chapter-4/4-139_early_inheritance.html: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /chapter-9/9-417_proxy.html: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /chapter-9/9-422_array_includes.html: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /chapter-3/3-99_collecting_var_minification.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /chapter-5/5-179_setting_listener_separately.js: -------------------------------------------------------------------------------- 1 | 2 | (function () { 3 | var x, y, cell; 4 | for (x = 0; x < 100; x++) { 5 | for (y = 0; y < 100; y++) { 6 | cell = document.getElementById("cell" + ("0" + x).substr(-2) + ("0" + y).substr(-2)); 7 | cell.onmouseover = function () { 8 | this.style.backgroundColor = "#EEEEEE"; 9 | }; 10 | cell.onmouseover = function () { 11 | this.sytle.backgroundColor = "#FFFFFF"; 12 | }; 13 | cell.onclick = function () { 14 | alert(this.innerHTML); 15 | }; 16 | } 17 | } 18 | }()); 19 | 20 | -------------------------------------------------------------------------------- /chapter-3/3-98_multiple_var_minification.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /chapter-9/9-388_class.js: -------------------------------------------------------------------------------- 1 | 2 | class Car { 3 | constructor(name) { 4 | this.name = name; 5 | this.type = "Car"; 6 | } 7 | getName() { 8 | return this.name; 9 | } 10 | } 11 | let car = new Car("My car"); 12 | console.log("car.getName(): " + car.getName()); 13 | 14 | 15 | class SUV extends Car { 16 | constructor(name) { 17 | super(name); 18 | this.type = "SUV"; 19 | } 20 | } 21 | 22 | let suv = new SUV("My SUV"); 23 | console.log("suv instanceof SUV: " + (suv instanceof SUV)); 24 | console.log("suv instanceof Car: " + (suv instanceof Car)); 25 | console.log("suv.getName(): " + suv.getName()); 26 | console.log(SUV); 27 | 28 | -------------------------------------------------------------------------------- /chapter-3/3-100_avoiding_global.js: -------------------------------------------------------------------------------- 1 | 2 | // With IIFE / Closure 3 | (function () { 4 | var localVariable = "I'm not global"; 5 | }()); 6 | 7 | 8 | // With module 9 | var myModule = (function () { 10 | var localVariable = "I'm an inside local variable"; 11 | return { 12 | show: function () { 13 | alert(localVariable); 14 | } 15 | }; 16 | }()); 17 | 18 | myModule.show(); 19 | 20 | 21 | 22 | (function (window) { 23 | var localVariable = "I'm an inside local variable"; 24 | 25 | window.myModule = { 26 | show: function () { 27 | alert(localVariable); 28 | } 29 | }; 30 | }(window)); 31 | 32 | myModule.show(); 33 | -------------------------------------------------------------------------------- /chapter-2/2-37_using_with.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Using with
4 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /chapter-6/6-304_web_worker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /chapter-9/9-405_fibonacci_for_of.html: -------------------------------------------------------------------------------- 1 | 25 | 26 | -------------------------------------------------------------------------------- /chapter-3/3-70_global_xmlhttprequest.html: -------------------------------------------------------------------------------- 1 | 3 |
Global XMLHttpRequest example
4 | 5 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter-6/worker.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var messages = { 3 | "doLargeLoop": function () { 4 | var i, 5 | sum = 0, 6 | start, end; 7 | 8 | console.log("Worker thread: Starting large loop"); 9 | start = Date.now(); 10 | 11 | for (i = 0 ; i < 10000000000 ; i++) { 12 | sum += i; 13 | } 14 | end = Date.now(); postMessage(`Elapsed time(${((end - start) / 1000).toFixed(2)} sec, sum=${sum})`); 15 | } 16 | }; 17 | 18 | onmessage = function (msg) { 19 | if (messages.hasOwnProperty(msg.data)) { 20 | messages[msg.data](); 21 | } 22 | } 23 | }()); 24 | -------------------------------------------------------------------------------- /chapter-4/4-118_this.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /chapter-4/4-133_printing_all_properties.html: -------------------------------------------------------------------------------- 1 | 30 | -------------------------------------------------------------------------------- /chapter-3/3-74_async_request_issue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter-4/4-132_prototype_chain.html: -------------------------------------------------------------------------------- 1 | 34 | -------------------------------------------------------------------------------- /chapter-8/8-365_open_bracket_newline.html: -------------------------------------------------------------------------------- 1 | 34 | -------------------------------------------------------------------------------- /chapter-4/4-148_object_create_object.html: -------------------------------------------------------------------------------- 1 | 25 | 26 | -------------------------------------------------------------------------------- /chapter-9/9-407_iterator.html: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /chapter-6/6-269_nesting_level_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 25 | 26 | -------------------------------------------------------------------------------- /chapter-9/9-418_symbol.html: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /chapter-9/9-396_template_string_expression_multiline.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Name: 4 |

 5 |     

 6 |     
21 | 
22 | 
23 | 


--------------------------------------------------------------------------------
/chapter-3/3-64_instanceof_primitive_type.html:
--------------------------------------------------------------------------------
 1 | 
20 | 


--------------------------------------------------------------------------------
/chapter-6/6-307_shared_workder.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 |     
 9 |     
25 | 
26 | 
27 | 
28 | 


--------------------------------------------------------------------------------
/chapter-5/5-222_compatibility_with_init_time_branching.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
27 | 


--------------------------------------------------------------------------------
/chapter-9/9-420_promise_flow_control.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
27 | 
28 | 


--------------------------------------------------------------------------------
/chapter-4/4-130_circular_reference.html:
--------------------------------------------------------------------------------
 1 | 
31 | 


--------------------------------------------------------------------------------
/chapter-3/3-102_javascript_inside_html.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |     
4 | 5 | 6 | 7 |
8 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /chapter-9/9-409_iterator_flow_control.html: -------------------------------------------------------------------------------- 1 | 33 | 34 | -------------------------------------------------------------------------------- /chapter-2/2-44_static_with_closer.html: -------------------------------------------------------------------------------- 1 | 33 | -------------------------------------------------------------------------------- /chapter-5/5-241_adding_currying_function_prototype.html: -------------------------------------------------------------------------------- 1 | 2 | 32 | -------------------------------------------------------------------------------- /chapter-5/5-237_callback_pattern.html: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | -------------------------------------------------------------------------------- /chapter-5/5-224_xmlhttprequest_with_self_defining_function.html: -------------------------------------------------------------------------------- 1 | 2 | 30 | -------------------------------------------------------------------------------- /chapter-9/9-415_typed_array.js: -------------------------------------------------------------------------------- 1 | class Employer { 2 | constructor (arrayBuffer = new ArrayBuffer(24)) { 3 | this._arrayBuffer = arrayBuffer; 4 | this._id = new Uint32Array(arrayBuffer, 0, 1); 5 | this._name = new Uint8Array(arrayBuffer, 4, 16); 6 | this._manMonth = new Float32Array(arrayBuffer, 20, 1); 7 | } 8 | 9 | set id(id) { 10 | this._id[0] = id; 11 | this._arrayBuffer.set(id); 12 | } 13 | 14 | get id() { 15 | return this._id[0]; 16 | } 17 | 18 | set name(name) { 19 | this._name[0] = name; 20 | } 21 | 22 | get name() { 23 | return this._name[0]; 24 | } 25 | 26 | set manMonth(manMonth) { 27 | this._manMonth[0] = manMonth; 28 | } 29 | 30 | get manMonth() { 31 | return this._manMonth[0]; 32 | } 33 | 34 | get toByte() { 35 | return this._arrayBuffer; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /chapter-5/5-180_setting_listener_delegate.js: -------------------------------------------------------------------------------- 1 | 2 | (function () { 3 | var wrapper = document.getElementById("tableWrapper"); 4 | wrapper.addEventListener("mouseover", function () { 5 | var target = event.target || event.srcElement; 6 | if (target.id && target.id.indexOf("cell") > -1) { 7 | target.style.backgroundColor = "#EEEEEE"; 8 | } 9 | }, true); 10 | wrapper.addEventListener("mouseout", function () { 11 | var target = event.target || event.srcElement; 12 | if (target.id && target.id.indexOf("cell") > -1) { 13 | target.style.backgroundColor = "#FFFFFF"; 14 | } 15 | }, true); 16 | wrapper.addEventListener("click", function () { 17 | var target = event.target || event.srcElement; 18 | if (target.id && target.id.indexOf("cell") > -1) { 19 | alert(target.innerHTML); 20 | } 21 | }, true); 22 | }()); 23 | 24 | -------------------------------------------------------------------------------- /chapter-9/9-401_destructuring_example.html: -------------------------------------------------------------------------------- 1 | 2 | 27 | -------------------------------------------------------------------------------- /chapter-2/2-49_setInterval_closer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
Pending
5 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /chapter-4/4-151_accessor.html: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /chapter-5/5-200_backup_wrapped_function_with_proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | -------------------------------------------------------------------------------- /chapter-5/5-220_compatibility_for_standard.html: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | -------------------------------------------------------------------------------- /chapter-6/sharedWorker.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var messages = { 3 | "doLargeLoop": function (port) { 4 | var i, 5 | sum = 0, 6 | start, end; 7 | port.postMessage("Worker thread: Starting large loop"); start = Date.now(); 8 | 9 | for (i = 0 ; i < 10000000000 ; i++) { 10 | sum += i; 11 | } 12 | end = Date.now(); 13 | port.postMessage(`Elapsed time(${((end - start) / 1000).toFixed(2)} sec, sum=${sum})`); 14 | }, 15 | "getConnection": function (port) { 16 | port.postMessage(`${connection} connections are connected`); 17 | } 18 | }, 19 | connection = 0; 20 | onconnect = function (e) { 21 | var port = e.ports[0]; connection++; 22 | port.onmessage = function (e) { 23 | if (messages.hasOwnProperty(e.data)) { 24 | messages[e.data](port); 25 | } 26 | }; 27 | port.start(); }; 28 | }()); 29 | -------------------------------------------------------------------------------- /chapter-3/3-103_split_javascript_and_html.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /chapter-5/5-230_cache_with_memoization.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /chapter-5/5-197_wrapper_with_proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 28 | 29 | -------------------------------------------------------------------------------- /chapter-5/5-227_prevent_duplicate_request.html: -------------------------------------------------------------------------------- 1 | 2 | 30 | -------------------------------------------------------------------------------- /chapter-6/6-266_requestanimationframe_shim.js: -------------------------------------------------------------------------------- 1 | 2 | (function () { 3 | var firstTimestamp = Date.now(); 4 | window.requestAnimationFrame = window.requestAnimationFrame || 5 | window.webkitRequestAnimationFrame || 6 | window.mozRequestAnimationFrame || 7 | function (callback) { 8 | if (callback instanceof Function) { 9 | return setTimeout(function () { 10 | callback.call(this, Date.now() - firstTimestamp); 11 | }, 1000 / 60); 12 | } else { 13 | return setTimeout(callback, 1000 / 60); 14 | } 15 | }; 16 | window.cancelAnimationFrame = window.cancelAnimationFrame || 17 | window.cancelRequestAnimationFrame || 18 | window.webkitCancelAnimationFrame || 19 | window.webkitCancelRequestAnimationFrame || 20 | window.mozCancelAnimationFrame || 21 | window.mozCancelRequestAnimationFrame || 22 | function (timeId) { 23 | clearTimeout(timeId); 24 | }; 25 | }()); 26 | -------------------------------------------------------------------------------- /chapter-5/5-219_compatibility_with_function.html: -------------------------------------------------------------------------------- 1 | 2 | 33 | -------------------------------------------------------------------------------- /chapter-5/5-242_unit_translate_with_currying.html: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | -------------------------------------------------------------------------------- /chapter-3/3-94_multiple_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /chapter-3/3-94_collecting_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 | 7 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /chapter-5/5-243_xmlhttprequest_currying.html: -------------------------------------------------------------------------------- 1 | 2 | 36 | 37 | -------------------------------------------------------------------------------- /chapter-6/6-279_position_relative_absolute.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 |
22 | 23 |
24 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /chapter-9/9-399_destructuring.html: -------------------------------------------------------------------------------- 1 | 2 | 41 | -------------------------------------------------------------------------------- /chapter-5/5-202_log_with_proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 41 | 42 | -------------------------------------------------------------------------------- /chapter-5/5-232_fibbonacci_wth_memoization.html: -------------------------------------------------------------------------------- 1 | 2 | 36 | -------------------------------------------------------------------------------- /chapter-5/5-229_adding_cache.html: -------------------------------------------------------------------------------- 1 | 2 | 38 | -------------------------------------------------------------------------------- /chapter-5/5-199_same_name_wrapper_with_proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | -------------------------------------------------------------------------------- /chapter-7/7-320_img_lazy_load.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /chapter-6/6-249_settimeout_2_seconds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 |
7 | 36 | 37 | -------------------------------------------------------------------------------- /chapter-5/5-217_compatibility_with_browser.html: -------------------------------------------------------------------------------- 1 | 2 | 37 | 38 | -------------------------------------------------------------------------------- /chapter-3/3-105_scope_chain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Mouse over Highlight
4 |
Floating Content
5 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /chapter-6/6-272_dom_repaint.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | 22 |
23 | <div> 24 | Click to change my background color 25 | </div> 26 |
27 |
28 | <div> 29 | Click to make me disappear 30 | </div> 31 |
Floating div
32 |
33 |
34 | <div> 35 | I won't move 36 | </div> 37 |
38 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /chapter-5/5-233_memoization_with_function_prototype.html: -------------------------------------------------------------------------------- 1 | 2 | 43 | 44 | -------------------------------------------------------------------------------- /chapter-6/6-300_memoization_dom_search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 |
10 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /chapter-3/3-82_how_to_loop_global.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /chapter-6/6-275_dom_reflow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 | 31 | 32 |
33 | <div> 34 | Click to change my width 35 | </div> 36 |
37 |
38 | <div> 39 | Click to make me disappear 40 | </div> 41 |
Floating div
42 |
43 |
44 | <div> 45 | I will move 46 | </div> 47 |
48 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /chapter-7/7-317_script_lazy_load.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
I need to show this important information as fast as possible
6 | 7 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /chapter-6/6-252_same_settimeout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 |
7 | 43 | 44 | -------------------------------------------------------------------------------- /chapter-3/3-110_set_style_variable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Mouse over Highlight
4 |
Floating Content
5 | 6 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /chapter-5/5-181_event_delegate_with_id.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |
7 | 8 | 9 | 10 | 11 |
12 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /chapter-6/6-301_cache_dom_variable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /chapter-3/3-108_shifting_scope_chain_to_local.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Mouse over Highlight
4 |
Floating Content
5 | 6 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /chapter-8/8-379_makefile: -------------------------------------------------------------------------------- 1 | project = vjgraph 2 | target-js-min = ${project}-min.js 3 | target-css-min = ${project}-min.css 4 | target-js-full = ${project}-full.js 5 | target-css-full = ${project}-full.css 6 | 7 | targets = ${target-js-min} \ 8 | ${target-js-min}.gz \ 9 | ${target-js-full} \ 10 | ${target-css-min} \ 11 | ${target-css-min}.gz \ 12 | ${target-css-full} 13 | 14 | #Source directory 15 | js_dir = ./js/ 16 | css_dir = ./css/ 17 | 18 | #Dependent libraries 19 | dependencies = ${js_dir}excanvas.min.js\ 20 | ${js_dir}util.js 21 | 22 | #Javscript files 23 | sources = ${js_dir}VJGraph.js\ 24 | ${js_dir}common.js 25 | #All files 26 | js_files = ${dependencies} ${sources} 27 | 28 | #Build all 29 | all: ${target-js-full} ${target-js-min} ${target-css-full} ${target-css-min} 30 | 31 | #Concatnate all files 32 | ${target-js-full}: ${js_files} 33 | cat > $@ $^ 34 | 35 | ${target-css-full}: ${css_files} 36 | cat > $@ $^ 37 | 38 | #Minification with closure compiler 39 | ${target-js-min}: ${target-js-full} 40 | java -jar compiler.jar --js $^ --js_output_file $@ 41 | gzip -c -9 $@ > $@.gz 42 | 43 | ${target-css-min}: ${target-css-full} 44 | java -jar yuicompressor-2.4.8.jar $^ -o $@ 45 | 46 | clean: 47 | rm -rf ${targets} 48 | 49 | commit: 50 | git add ${targets} 51 | git commit -a -m "Version: x.x.x" 52 | git push origin master 53 | 54 | deploy: 55 | git push production master 56 | 57 | dev: 58 | git push develop master 59 | 60 | install: commit deploy dev 61 | -------------------------------------------------------------------------------- /chapter-4/4-124_prototype.html: -------------------------------------------------------------------------------- 1 | 51 | -------------------------------------------------------------------------------- /chapter-2/2-51_closer_practical_example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | Adding below...
8 |
9 |
10 | 11 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /chapter-5/5-187_proxy_with_event_delegation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |
7 | 8 | 9 | 10 | 11 |
12 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /chapter-3/3-73_local_with_closer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | Adding below...
8 |
9 |
10 | 11 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /chapter-5/5-184_event_delegate_test_bubbling.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 |
7 | 8 | 9 | 10 | 11 |
12 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /chapter-6/6-255_setinterval_thread_queue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 |
7 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /chapter-6/6-295_change_background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
NameSubjectContents
14 |
15 |
16 |
17 | 18 | 19 | 20 | 21 |
22 |
23 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /chapter-7/7-323_img_lazy_load_background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /chapter-6/6-293_changing_display.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
NameSubjectContents
14 |
15 |
16 |
17 | 18 | 19 | 20 | 21 |
22 |
23 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /chapter-6/6-290_dom_clone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
NameSubjectContents
14 |
15 |
16 |
17 | 18 | 19 | 20 | 21 |
22 |
23 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /chapter-5/5-194_aggregating_requests_with_proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 |
15 |
16 | 17 | 18 |
19 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /chapter-5/5-225_initialization_with_self_defining_function.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 |
20 |
21 |
Comment
22 |
Name
23 |
24 |
25 | 26 |
27 | 28 | 29 | 30 |
31 | 32 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /chapter-5/5-212_decorator_with_proxy_for_monitoring.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /chapter-5/5-208_decorator_for_object.html: -------------------------------------------------------------------------------- 1 | 2 | 68 | 69 | -------------------------------------------------------------------------------- /chapter-9/9-390_object_expression.html: -------------------------------------------------------------------------------- 1 | 109 | -------------------------------------------------------------------------------- /chapter-5/5-188_data_collection_with_proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 14 | 15 | 16 | 17 | 18 |
19 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /chapter-6/6-281_reflow_minimized_notice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 33 | 34 | 35 |
I'll not reflow
36 |
37 |
    38 |
  • Link to the first article
  • 39 |
  • Link to the second article
  • 40 |
  • Link to the third article
  • 41 |
  • Link to the last article
  • 42 |
43 |
44 |
Neither me
45 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /chapter-5/5-191_cache_with_proxy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 14 | 15 | 16 | 17 | 18 |
19 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /chapter-6/6-258_clock_with_setinterval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 | 21 |
22 |
23 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /chapter-5/5-204_form_validate_decorator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 |
7 |
8 |
12 | 13 |
14 | 15 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /chapter-6/6-286_documentfragment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 31 | 32 | 33 |
34 | I'll not reflow 35 |
36 |
37 |
    38 |
  • Now loading
  • 39 |
40 |
41 |
42 | Neither me 43 |
44 | 45 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /chapter-6/6-261_setinterval_time_difference.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 |
20 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /chapter-5/5-168_event_bubbling_capturing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 35 | 36 | 37 |
38 |
39 |
40 | Bubbling 41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Capturing 49 |
50 |
51 |
52 |
53 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /chapter-5/5-174_modify_dom_propagation_path.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 35 | 36 | 37 |
38 |
39 |
40 | Bubbling 41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Capturing 49 |
50 |
51 |
52 |
53 | 98 | 99 | 100 | 101 | --------------------------------------------------------------------------------