This is my first time working with Drupal (Drupal 7).
I've created a jQuery plugin which populates a target div. The target div is added to the node via panelizer.
I only want to run the script for when it's needed. Just now it runs all the time. Even on the dashboard, this causes script errors.
I'm not sure what the best approach is for this.
EDIT (SOLUTION):
Thanks for the input. I decided to use a Javascript approach.
var elementExists = document.getElementById('target');
if (typeof(elementExists) != 'undefined' && elementExists != null) {
// Script
} else {
return;
}