Warning: session_start(): open(/www/htdocs/w017651d/tmp/wiki//sess_b5d07f98e4b90c9a0dff038ed2657d19, O_RDWR) failed: No such file or directory (2) in /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/init.php on line 247

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/init.php:247) in /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/init.php on line 247

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/init.php:247) in /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/auth.php on line 424

Warning: session_write_close(): open(/www/htdocs/w017651d/tmp/wiki//sess_b5d07f98e4b90c9a0dff038ed2657d19, O_RDWR) failed: No such file or directory (2) in /www/htdocs/w017651d/wiki.blackcat-cms.org/doku.php on line 121

Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/www/htdocs/w017651d/tmp/wiki/) in /www/htdocs/w017651d/wiki.blackcat-cms.org/doku.php on line 121

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/init.php:247) in /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/actions.php on line 210

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w017651d/wiki.blackcat-cms.org/inc/init.php:247) in /www/htdocs/w017651d/wiki.blackcat-cms.org/lib/tpl/dokuwiki/main.php on line 12
Script dynamisch laden [BlackCat CMS Dokumentation, Tutorials, Tipps und Tricks]

Benutzer-Werkzeuge

Webseiten-Werkzeuge


cookbook:jquery

Script dynamisch laden

Mit jQuery.getScript() lassen sich aus einem JavaScript heraus weitere JavaScripts nachladen.

https://api.jquery.com/jquery.getscript/

Praktisch daran ist, dass man für den Erfolgsfall (bzw. wenn das externe Script fertig geladen ist) weiteren Code ausführen kann.

$.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) {
    console.log( data ); // Data returned
    console.log( textStatus ); // Success
    console.log( jqxhr.status ); // 200
    console.log( "Load was performed." );
});

cookbook/jquery.txt · Zuletzt geändert: 2014/05/23 00:00 (Externe Bearbeitung)