Download presentation
Presentation is loading. Please wait.
Published byPrudence Fitzgerald Modified over 9 years ago
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
10
10
11
11
12
12
13
13
14
14 var myObject = eval('(' + myJSONtext + ')'); //JSON 파서 사용 //e.g json.org 의 json2.js var myObject = JSON.parse(myJSONtext, reviver); //JSON 파서 사용 //e.g json.org 의 json2.js var myObject = JSON.parse(myJSONtext, reviver);
15
15
16
16 $(document).ready(function () { $('.bold').click(function () { $(this).addClass('changeColor'); setTimeout(function () { $(this).removeClass('changeColor'); }, 1000); }); $(document).ready(function () { $('.bold').click(function () { $(this).addClass('changeColor'); setTimeout(function () { $(this).removeClass('changeColor'); }, 1000); }); $(document).ready(function () { $('.bold').click(function () { var $element = $(this); $element.addClass('changeColor'); setTimeout(function () { $element.removeClass('changeColor'); }, 1000); }); $(document).ready(function () { $('.bold').click(function () { var $element = $(this); $element.addClass('changeColor'); setTimeout(function () { $element.removeClass('changeColor'); }, 1000); });
17
17 $(document).ready(function(){ // focus the $('#username').focus(); }); $(document).ready(function(){ // focus the $('#username').focus(); });
18
18 (function($) { $(document).ready(function() { var months = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; months = $.grep(months, function(value, i) { return ( value.indexOf('J') == 0 ); }); $('#months').html( ' ' + months.join(' ') + ' ' ); }); })(jQuery); (function($) { $(document).ready(function() { var months = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; months = $.grep(months, function(value, i) { return ( value.indexOf('J') == 0 ); }); $('#months').html( ' ' + months.join(' ') + ' ' ); }); })(jQuery);
19
19 $(document).ready( function() { function fillTable( names ) { $.each( names, function() { $(' ').append( $(' ').addClass('name').html(esc(this.first) + ' ' + esc(this.last)) ).append( $(' ').addClass('address').html( esc(this.street) + ' ' + esc(this.city) + ', ' + esc(this.state) + ' ' + esc(this.zip) ) ).appendTo('#nameTable'); }); } $.getJSON( 'names/names-1000.json', function( json ) { fillTable( json.names ); }); $(document).ready( function() { function fillTable( names ) { $.each( names, function() { $(' ').append( $(' ').addClass('name').html(esc(this.first) + ' ' + esc(this.last)) ).append( $(' ').addClass('address').html( esc(this.street) + ' ' + esc(this.city) + ', ' + esc(this.state) + ' ' + esc(this.zip) ) ).appendTo('#nameTable'); }); } $.getJSON( 'names/names-1000.json', function( json ) { fillTable( json.names ); });
20
20 $(document).ready( function() { function fillTable( names ) { // Reduce name lookups with local function name var e = esc; // var html = [], h = ?1; html[++h] = ' '; for( var name, i = ?1; name = names[++i]; ) { html[++h] = ' '; html[++h] = e(name.first); html[++h] = ' '; html[++h] = e(name.last); html[++h] = ' '; html[++h] = e(name.street); html[++h] = ' '; html[++h] = e(name.city); html[++h] = ', '; html[++h] = e(name.state); html[++h] = ' '; html[++h] = e(name.zip); html[++h] = ' '; } html[++h] = ' '; $('#container')[0].innerHTML = html.join(''); } $.getJSON( 'names/names-1000.json', function( json ) { fillTable( json.names ); }); $(document).ready( function() { function fillTable( names ) { // Reduce name lookups with local function name var e = esc; // var html = [], h = ?1; html[++h] = ' '; for( var name, i = ?1; name = names[++i]; ) { html[++h] = ' '; html[++h] = e(name.first); html[++h] = ' '; html[++h] = e(name.last); html[++h] = ' '; html[++h] = e(name.street); html[++h] = ' '; html[++h] = e(name.city); html[++h] = ', '; html[++h] = e(name.state); html[++h] = ' '; html[++h] = e(name.zip); html[++h] = ' '; } html[++h] = ' '; $('#container')[0].innerHTML = html.join(''); } $.getJSON( 'names/names-1000.json', function( json ) { fillTable( json.names ); });
21
21 $(document).ready(function() { var xml = ' Hello world! '; var title = $.xmlDOM( xml ).find('myxml > title').text(); $('#title').html( title ); }); $(document).ready(function() { var xml = ' Hello world! '; var title = $.xmlDOM( xml ).find('myxml > title').text(); $('#title').html( title ); });
22
22
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.