SlideShare uma empresa Scribd logo
1 de 45
Java + Script
      训   JavaScript




    UED
JavaScript   Java
                    …
                    Java
…
…
,
Java         JavaScript


                          ,
Java   JavaScript
Java + Script
           =
Groovy || JRuby || Scala
Java + Script
    |!=|
 JavaScript
JavaScript is
JavaScript is




JavaScript
1.
JavaScript


      App

      Tbra

      YUI

Native JavaScript
Native JavaScript


简单
YUI
Tbra
Resource
JavaScript:
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference


YUI:
http://developer.yahoo.com/yui/2/


Tbra:
http://assets.taobaocdn.com/tbra/1.0/examples/
[             ]

          JavaScript

    YUI

     Tbra


Reference    Example
2.
source
(abc.source.js)
source
(abc.source.js)


  source
 abc.js
source
(abc.source.js)   {
abc.source.js?t=20121212.js
abc.source.css?t=20121212.css
Demo




       Assets
<script src=”abc.js” />



<script src=”abc.js”></script>
[        ]

         source
source



                      assets

   script
3.
{
    (function() {
          //code here
    })();


                        }
var fn = function() {
     //code here
};
fn();
var fn = function() {
     //code here
};
fn();
var fn = function() {
     //code here
};
fn();
(function() {
     //code here
}) ();
(function() {
      var Dom = YAHOO.util.Dom,
      Event = YAHOO.util.Event;

        //my code
})();
<button onclick=”doSomething();” />



     <button id=”J_Button” />
     YAHOO.util.Event.on(‘J_Button’, ‘click’, function() {
         //doSomething
     });
<button onclick=”doSomething();” />



     <button id=”J_Button” />
     YAHOO.util.Event.on(‘J_Button’, ‘click’, function() {
         //doSomething
     });
OK,
(function {
   var Event = YAHOO.util.Event;
   Event.on(‘J_Button’, ‘click’, function() {
       //doSomething
   });
})();
[         ]



              YUI




    UED
4.
JSON
JSON
Java&Script

Mais conteúdo relacionado

Mais procurados

jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Knowgirish82
 
hachioji.pm #40 : asynchronous in JS
hachioji.pm #40 : asynchronous in JShachioji.pm #40 : asynchronous in JS
hachioji.pm #40 : asynchronous in JSKotaro Kawashima
 
AngularJS - $http & $resource Services
AngularJS - $http & $resource ServicesAngularJS - $http & $resource Services
AngularJS - $http & $resource ServicesEyal Vardi
 
A Self Replicating Serverless Function
A Self Replicating Serverless FunctionA Self Replicating Serverless Function
A Self Replicating Serverless FunctionMichael Adda
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitRebecca Murphey
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery ApplicationsRebecca Murphey
 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the newRemy Sharp
 
JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentalsBastian Feder
 
ES2015のカバレッジ計測
ES2015のカバレッジ計測ES2015のカバレッジ計測
ES2015のカバレッジ計測sinsoku listy
 
Nodejs do teste de unidade ao de integração
Nodejs  do teste de unidade ao de integraçãoNodejs  do teste de unidade ao de integração
Nodejs do teste de unidade ao de integraçãoVinícius Pretto da Silva
 
Jquery plugin development
Jquery plugin developmentJquery plugin development
Jquery plugin developmentMd. Ziaul Haq
 
AngularJS Routing
AngularJS RoutingAngularJS Routing
AngularJS RoutingEyal Vardi
 
Jquery Plugin
Jquery PluginJquery Plugin
Jquery PluginRavi Mone
 
A piece of sugar in your client-side development
A piece of sugar in your client-side developmentA piece of sugar in your client-side development
A piece of sugar in your client-side developmentNicolas Blanco
 
Engineering JavaScript
Engineering JavaScriptEngineering JavaScript
Engineering JavaScriptJim Purbrick
 

Mais procurados (20)

jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
 
hachioji.pm #40 : asynchronous in JS
hachioji.pm #40 : asynchronous in JShachioji.pm #40 : asynchronous in JS
hachioji.pm #40 : asynchronous in JS
 
AngularJS - $http & $resource Services
AngularJS - $http & $resource ServicesAngularJS - $http & $resource Services
AngularJS - $http & $resource Services
 
A Self Replicating Serverless Function
A Self Replicating Serverless FunctionA Self Replicating Serverless Function
A Self Replicating Serverless Function
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
Dojo Confessions
Dojo ConfessionsDojo Confessions
Dojo Confessions
 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
 
JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentals
 
ES2015のカバレッジ計測
ES2015のカバレッジ計測ES2015のカバレッジ計測
ES2015のカバレッジ計測
 
Intro to jquery
Intro to jqueryIntro to jquery
Intro to jquery
 
Nodejs do teste de unidade ao de integração
Nodejs  do teste de unidade ao de integraçãoNodejs  do teste de unidade ao de integração
Nodejs do teste de unidade ao de integração
 
Jquery plugin development
Jquery plugin developmentJquery plugin development
Jquery plugin development
 
Xmpp prebind
Xmpp prebindXmpp prebind
Xmpp prebind
 
AngularJS Routing
AngularJS RoutingAngularJS Routing
AngularJS Routing
 
Jquery Plugin
Jquery PluginJquery Plugin
Jquery Plugin
 
PhoneGap: Local Storage
PhoneGap: Local StoragePhoneGap: Local Storage
PhoneGap: Local Storage
 
Add loop shortcode
Add loop shortcodeAdd loop shortcode
Add loop shortcode
 
A piece of sugar in your client-side development
A piece of sugar in your client-side developmentA piece of sugar in your client-side development
A piece of sugar in your client-side development
 
Engineering JavaScript
Engineering JavaScriptEngineering JavaScript
Engineering JavaScript
 

Destaque

Borang Penerimaan Tawaran
Borang  Penerimaan  TawaranBorang  Penerimaan  Tawaran
Borang Penerimaan Tawaranahmad hafizi
 
Borang Penerimaan Tawaran
Borang  Penerimaan  TawaranBorang  Penerimaan  Tawaran
Borang Penerimaan Tawaranahmad hafizi
 
Surat setuju terima tawaran perlantikan dg41
Surat setuju terima tawaran perlantikan dg41Surat setuju terima tawaran perlantikan dg41
Surat setuju terima tawaran perlantikan dg41Nadzari Baharom
 
Surat penerimaan lamaran kerja b.indo dan b.ing
Surat penerimaan lamaran kerja b.indo dan b.ingSurat penerimaan lamaran kerja b.indo dan b.ing
Surat penerimaan lamaran kerja b.indo dan b.inganisa_elf2
 
Dokumen Tender
Dokumen Tender Dokumen Tender
Dokumen Tender no suhaila
 

Destaque (7)

Borang Penerimaan Tawaran
Borang  Penerimaan  TawaranBorang  Penerimaan  Tawaran
Borang Penerimaan Tawaran
 
Borang Penerimaan Tawaran
Borang  Penerimaan  TawaranBorang  Penerimaan  Tawaran
Borang Penerimaan Tawaran
 
Surat setuju terima tawaran perlantikan dg41
Surat setuju terima tawaran perlantikan dg41Surat setuju terima tawaran perlantikan dg41
Surat setuju terima tawaran perlantikan dg41
 
Surat penerimaan lamaran kerja b.indo dan b.ing
Surat penerimaan lamaran kerja b.indo dan b.ingSurat penerimaan lamaran kerja b.indo dan b.ing
Surat penerimaan lamaran kerja b.indo dan b.ing
 
Surat balasan
Surat balasanSurat balasan
Surat balasan
 
Borang setuju terima
Borang setuju terimaBorang setuju terima
Borang setuju terima
 
Dokumen Tender
Dokumen Tender Dokumen Tender
Dokumen Tender
 

Semelhante a Java&Script

JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript EverywherePascal Rettig
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 
Activity streams lightning talk, DjangoCon 2011 Day 3
Activity streams lightning talk, DjangoCon 2011 Day 3Activity streams lightning talk, DjangoCon 2011 Day 3
Activity streams lightning talk, DjangoCon 2011 Day 3Steve Ivy
 
Activity streams Lightning Talk, DjangoCon 2011, Day3
Activity streams Lightning Talk, DjangoCon 2011, Day3Activity streams Lightning Talk, DjangoCon 2011, Day3
Activity streams Lightning Talk, DjangoCon 2011, Day3Steve Ivy
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiPraveen Puglia
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Peter Higgins
 
Ember background basics
Ember background basicsEmber background basics
Ember background basicsPhilipp Fehre
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & GroovyGrails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & GroovyHenk Jurriens
 
Javascript - The Good, the Bad and the Ugly
Javascript - The Good, the Bad and the UglyJavascript - The Good, the Bad and the Ugly
Javascript - The Good, the Bad and the UglyThorsten Suckow-Homberg
 

Semelhante a Java&Script (20)

The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
 
YUI on the go
YUI on the goYUI on the go
YUI on the go
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Activity streams lightning talk, DjangoCon 2011 Day 3
Activity streams lightning talk, DjangoCon 2011 Day 3Activity streams lightning talk, DjangoCon 2011 Day 3
Activity streams lightning talk, DjangoCon 2011 Day 3
 
Activity streams Lightning Talk, DjangoCon 2011, Day3
Activity streams Lightning Talk, DjangoCon 2011, Day3Activity streams Lightning Talk, DjangoCon 2011, Day3
Activity streams Lightning Talk, DjangoCon 2011, Day3
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbai
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.
 
Javascript in Plone
Javascript in PloneJavascript in Plone
Javascript in Plone
 
How to React Native
How to React NativeHow to React Native
How to React Native
 
Ember background basics
Ember background basicsEmber background basics
Ember background basics
 
DrupalCon jQuery
DrupalCon jQueryDrupalCon jQuery
DrupalCon jQuery
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & GroovyGrails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
 
YUI 3
YUI 3YUI 3
YUI 3
 
Javascript - The Good, the Bad and the Ugly
Javascript - The Good, the Bad and the UglyJavascript - The Good, the Bad and the Ugly
Javascript - The Good, the Bad and the Ugly
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 

Java&Script