Blog

JavaScript

TinyMCE’s pagebreak plugin is a handy way of providing users a way of marking breaks in content by placing a HTML comment in the source code denoting the break. However, if you are using the editor’s valid_elements attribute to restrict HTML elements used in the content (a good idea if you don’t want all sorts of messy markup getting added) you need to make sure you allow comment tags.

The TinyMCE link dialog.

If you’re using the link plugin for TinyMCE to add links to content and want to get rid of the target attribute options then the trick is to set target_list to false in the editor’s configuration.

5 Functions of the Console Object You Didn’t Know

#

If you’re debugging JavaScript you’ve probably heard of and used console.log(), but there’s much more to the Console object. This article discusses 5 functions of the Console object that you may not have heard of, but you’ll want to start using from now.

JavaScript: Taking Off the Training Wheels

#

A good motivational article on getting to grips with coding JavaScript (without using libraries like jQuery).

If nothing else, learning JavaScript will improve your jQuery code; you’ll be comfortable writing jQuery from scratch and feel happy bending others’ code to your own purposes. Writing efficient, fast and bug-free jQuery is also made much easier when you have a good appreciation of JavaScript, because you can look at what jQuery is really doing.

The inclusion of jQuery in a custom Drupal theme seems to cause a lot of confusion to people new to Drupal. There is, of course, a proper way of doing it and it's not that difficult once you know how.