3

我正在使用 noUISlider - http://refreshless.com/nouislider/nouislider.js通过 enqueue 脚本添加滑块时,我在 firebug中Wordpress收到以下错误 -javascript

TypeError: target is null

if ( !target.nodeName ) {

在这里,我如何将脚本排入队列 -

wp_register_script('realstate-noui', BRPC_BASE_URL . 'js/nouislider.js');
wp_enqueue_script('realstate-noui');

nouislider.js发生错误的代码-

function initialize ( target, originalOptions ) {

		if ( !target.nodeName ) {
			throw new Error('noUiSlider.create requires a single element.');
		}

		// Test the options and create the slider environment;
		var options = testOptions( originalOptions, target ),
			slider = closure( target, options );

		// Use the public value method to set the start values.
		slider.set(options.start);

		target.noUiSlider = slider;
	}

	// Use an object instead of a function for future expansibility;
	return {
		create: initialize
	};

4

0 回答 0