Does Uncaught Referenceerror help?

Asked

Viewed 43 times

0

I’m having this mistake:

Uncaught Referenceerror: szClose is not defined

at jquery.colorbox.js?x=30:45
at jquery.colorbox.js?x=30:1026

where is the problem?

(function ($, document, window) {
	var
	// Default settings object.
	// See http://jacklmoore.com/colorbox for details.
	defaults = {
		transition: "none",
		speed: 300,
		fadeOut: 300,
		width: false,
		initialWidth: "400",
		innerWidth: false,
		maxWidth: false,
		height: false,
		initialHeight: "150",
		innerHeight: false,
		maxHeight: false,
		scalePhotos: true,
		scrolling: false,
		inline: false,
		html: false,
		iframe: false,
		fastIframe: true,
		photo: false,
		href: false,
		title: true,
		rel: false,
		opacity: 0.8,
		preloading: false,
		className: false,

		// alternate image paths for high-res displays
		retinaImage: false,
		retinaUrl: false,
		retinaSuffix: '@2x.$1',

		// internationalization
		current: "image {current} of {total}",
		previous: "previous",
		next: "next",
		close: szClose,
		xhrError: "This content failed to load.",
		imgError: "This image failed to load.",

  • 1

    The code is incomplete try to put a minimum verifiable example that reproduces the problem. Using a jquery plugin for color ? Tag php because it has some code php associated with this that causes the problem? Take advantage and try detail to the maximum your problem.

  • I don’t understand the code

  • 1

    But the part that is making the mistake is not the only one that contributes to the error. Not to mention that even the code snippet you placed is not complete because at least the closures of ( and { open. I advise however to put the use of this defauts and even the associated html

1 answer

0

Reading the plugin documentation Colorbox note in session Settings ( Settings ) that option close receives type value Texto or HTML, the error is occurring because szClose there is no.

You can solve it in two ways.

  • Create a variable before the line var defaults

    var szClose = "Fechar";
    
  • Change the option value close

    close: "Fechar"
    

Note: I only answered because the error is clear even if the code is not complete.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.