Tag: JavaScript

  • WordPress & jQuery: Fix JavaScript error “$ is not a function”

    When using jQuery in WordPress you might be surprised by a $ is not a function JavaScript error. For example, in a default WordPress 3.3.1 installation, the following JavaScript code leads to this error: $(document).ready(function() { console.log($(“body”)); }); The reason is, that WordPress by default uses jQuery’s “no conflict mode” to avoid compatibility problems with […]

  • jQuery: Disable (browser) cache for all AJAX requests

    Here is a small JavaScript code snippet that uses jQuery’s .ajax() function to disable the (client side browser) cache for all subsequent jQuery AJAX calls (note that caching is enabled by default for all data types except script and jsonp): $.ajaxSetup({ cache: false }); To enable caching for a special AJAX request one can override […]

  • ASP.NET: Programmatically adding <script> tags to include JavaScript files in the master page’s <head> tag

    One common task of ASP.NET master pages is the definition of the page’s <head> tag, which could include <script> tags to include external JavaScript files>. If you do not use absolute paths to refer to the JavaScript file, adding a <script> leads to the problem, that the path to the JavaScript file has to consider […]

  • Update MooTools Core from 1.2.5 to 1.3 breaks inheritance structures

    Update 2010-12-20: I created a bug report which was set to “wontfix”. As Christopher Pojer explained here there is no guarantee that this.parent is defined in classes that are used as interfaces. Some weeks ago, I wrote about two API breaks I found in MooTools Core 1.3 when I tried to upgrade from 1.2.5. After […]

  • Update MooTools from 1.2.5 to 1.3: API breaks with (inbuilt) compatibility layer

    Update 2010-10-20: The MooTools team decided that both API changes are not API breaks, but fixes. In detail, both functionalities I’ve used in 1.2.5 are undocumented and officially unsupported features (see Christoph Pojer’s comment and my bug report). The migration guide “Update from 1.2 to 1.3” now refers to the changes in the Request objects. […]

  • SCORM 1.2 & Opera: Hints to develop SCORM compliant learning content

    Introduction The eLearning standard “SCORM 1.2” defines a JavaScript API to exchange date between the Learning Management (LMS) and the learning content, called Sharable Content Object (SCO) by SCORM. Basically, this API defines a handful JavaScript functions that the LMS has to provide to the SCO to initialize and finish the communication, transfer data, and […]