SlideShare a Scribd company logo
1 of 8
JQUERY
Anwednungsbeispiele
WAS IST JQUERY?



• Javascript   Framework
JAVASCRIPT-FRAMEWORKS?


• Bibliotheken   mit Funktionen

• Funktionenzum modifizieren von DOM und Navigation
 = einfacheres und schnelleres Entwickeln

• Es
   gibt viele Frameworks:
 jQuery, MooTools, Prototype, Scriptaculous, Dojo, YUI, Rico...
WARUM JQUERY?


• Populärstes   Framework > Viele Plugins (4000+)

• Entwicklerfreundlich

• Freundlich   zu anderen Bibliotheken

• Browserfreundlich
BEISPIEL WAS JQUERY
 EINFACHER MACHT
•   /* is this stuff defined? */



if (!document.ELEMENT_NODE) {

    document.ELEMENT_NODE = 1;

    document.ATTRIBUTE_NODE = 2;

    document.TEXT_NODE = 3;

    document.CDATA_SECTION_NODE = 4;

    document.ENTITY_REFERENCE_NODE = 5;

    document.ENTITY_NODE = 6;

    document.PROCESSING_INSTRUCTION_NODE = 7;

    document.COMMENT_NODE = 8;

    document.DOCUMENT_NODE = 9;

    document.DOCUMENT_TYPE_NODE = 10;

    document.DOCUMENT_FRAGMENT_NODE = 11;

    document.NOTATION_NODE = 12;
}

document._importNode = function(node, allChildren) {

    /* find the node type to import */

    switch (node.nodeType) {

    
    case document.ELEMENT_NODE:

    
    
    /* create a new element */

    
    
    var newNode = document.createElement(node.nodeName);

    
    
    /* does the node have any attributes to add? */

    
    
    if (node.attributes && node.attributes.length > 0)

    
    
    
    /* add all of the attributes */

    
    
    
    for (var i = 0, il = node.attributes.length; i < il;)

    
    
    
    
    newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i+
+].nodeName));

    
    
    /* are we going after children too, and does the node have any? */

    
    
    if (allChildren && node.childNodes && node.childNodes.length > 0)

    
    
    
    /* recursively get all of the child nodes */

    
    
    
    for (var i = 0, il = node.childNodes.length; i < il;)

    
    
    
    
    newNode.appendChild(document._importNode(node.childNodes[i++], allChildren));

    
    
    return newNode;

    
    
    break;

    
    case document.TEXT_NODE:

    
    case document.CDATA_SECTION_NODE:

    
    case document.COMMENT_NODE:

    
    
    return document.createTextNode(node.nodeValue);

    
    
    break;

    }
};
•   $(„#content“).load(seite2.html #content“);
•   Beispiele

More Related Content

Viewers also liked

MIS 05 Decision Support Systems
MIS 05  Decision Support SystemsMIS 05  Decision Support Systems
MIS 05 Decision Support SystemsTushar B Kute
 
Study techniques of programming in c at kkwpss
Study techniques of programming in c at kkwpssStudy techniques of programming in c at kkwpss
Study techniques of programming in c at kkwpssTushar B Kute
 
Textadcash- Cell Phone Marketing
Textadcash- Cell Phone MarketingTextadcash- Cell Phone Marketing
Textadcash- Cell Phone Marketingpremierfg
 
4HimDebt Solutions
4HimDebt Solutions4HimDebt Solutions
4HimDebt Solutionspremierfg
 
Realfit Wellness Opportunity
Realfit Wellness OpportunityRealfit Wellness Opportunity
Realfit Wellness Opportunitypremierfg
 
Christmas card for_u
Christmas card for_uChristmas card for_u
Christmas card for_uLing Inn
 
Module 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CModule 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CTushar B Kute
 
MIS 14 Supply Chain Management
MIS 14 Supply Chain ManagementMIS 14 Supply Chain Management
MIS 14 Supply Chain ManagementTushar B Kute
 

Viewers also liked (9)

MIS 05 Decision Support Systems
MIS 05  Decision Support SystemsMIS 05  Decision Support Systems
MIS 05 Decision Support Systems
 
Study techniques of programming in c at kkwpss
Study techniques of programming in c at kkwpssStudy techniques of programming in c at kkwpss
Study techniques of programming in c at kkwpss
 
Textadcash- Cell Phone Marketing
Textadcash- Cell Phone MarketingTextadcash- Cell Phone Marketing
Textadcash- Cell Phone Marketing
 
4HimDebt Solutions
4HimDebt Solutions4HimDebt Solutions
4HimDebt Solutions
 
Realfit Wellness Opportunity
Realfit Wellness OpportunityRealfit Wellness Opportunity
Realfit Wellness Opportunity
 
Christmas card for_u
Christmas card for_uChristmas card for_u
Christmas card for_u
 
Module 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CModule 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in C
 
MIS 12 E-Governance
MIS 12 E-GovernanceMIS 12 E-Governance
MIS 12 E-Governance
 
MIS 14 Supply Chain Management
MIS 14 Supply Chain ManagementMIS 14 Supply Chain Management
MIS 14 Supply Chain Management
 

Jsq

  • 2. WAS IST JQUERY? • Javascript Framework
  • 3. JAVASCRIPT-FRAMEWORKS? • Bibliotheken mit Funktionen • Funktionenzum modifizieren von DOM und Navigation = einfacheres und schnelleres Entwickeln • Es gibt viele Frameworks: jQuery, MooTools, Prototype, Scriptaculous, Dojo, YUI, Rico...
  • 4. WARUM JQUERY? • Populärstes Framework > Viele Plugins (4000+) • Entwicklerfreundlich • Freundlich zu anderen Bibliotheken • Browserfreundlich
  • 5. BEISPIEL WAS JQUERY EINFACHER MACHT
  • 6. /* is this stuff defined? */ if (!document.ELEMENT_NODE) { document.ELEMENT_NODE = 1; document.ATTRIBUTE_NODE = 2; document.TEXT_NODE = 3; document.CDATA_SECTION_NODE = 4; document.ENTITY_REFERENCE_NODE = 5; document.ENTITY_NODE = 6; document.PROCESSING_INSTRUCTION_NODE = 7; document.COMMENT_NODE = 8; document.DOCUMENT_NODE = 9; document.DOCUMENT_TYPE_NODE = 10; document.DOCUMENT_FRAGMENT_NODE = 11; document.NOTATION_NODE = 12; } document._importNode = function(node, allChildren) { /* find the node type to import */ switch (node.nodeType) { case document.ELEMENT_NODE: /* create a new element */ var newNode = document.createElement(node.nodeName); /* does the node have any attributes to add? */ if (node.attributes && node.attributes.length > 0) /* add all of the attributes */ for (var i = 0, il = node.attributes.length; i < il;) newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i+ +].nodeName)); /* are we going after children too, and does the node have any? */ if (allChildren && node.childNodes && node.childNodes.length > 0) /* recursively get all of the child nodes */ for (var i = 0, il = node.childNodes.length; i < il;) newNode.appendChild(document._importNode(node.childNodes[i++], allChildren)); return newNode; break; case document.TEXT_NODE: case document.CDATA_SECTION_NODE: case document.COMMENT_NODE: return document.createTextNode(node.nodeValue); break; } };
  • 7. $(„#content“).load(seite2.html #content“);
  • 8. Beispiele

Editor's Notes