• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

prettyPhoto undefined description

November 15, 2011 by Webhead

Problem

I had “undefined” showing up in the description of my lightbox whenever I left out the “title” attribute in my link.

 

Solution

I am using jQuery 1.6.2, the examples used 1.4.2.   To resolve the problem, look to change something like this:

 

if(pp_descriptions[set_position] != ""){
				$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));
			}else{
				$pp_pic_holder.find('.pp_description').hide();
			}

to this:

if(typeof pp_descriptions[set_position] != 'undefined' && pp_descriptions[set_position] != ""){
				$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));
			}else{
				$pp_pic_holder.find('.pp_description').hide();
			}

 

search terms used:  prettyphoto undefined description
source: http://forums.no-margin-for-errors.com/discussion/1915/when-there-is-no-title-element-displays-undefined/#Item_3

 

 

Filed Under: Coding Tagged With: jquery, open source

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools