<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$(document).ready(function() {
	// è‰²é•ã„èª­ã¿è¾¼ã¿
	var params = {
		type : 'GET',
		cache : false,
		timeout : 30000,
		url : '/commodity/' + $('#commodityCode').val() + '/colors'
	};
    otherColorDisplay('#different_color_list', params, "#different_color_list_template");
});

var otherColorDisplay = function(targetId, data, templateId) {
    $.ajax(data).then(function(data, sts) {
        Handlebars.registerHelper('trimString', function(string) {
            return new Handlebars.SafeString(string.substring(0,2))
        });
        data.base_url = $('#baseUrl').val();
        data.image_url = $('#imageUrl').val();
        data.catalog_param = $('#catalogParam').val();
        if ($(templateId).length) {
            // template in script tag
            var source = $(templateId).html();
            var template = Handlebars.compile(source);
        } else {
            var template = Handlebars.templates[templateId];
        }
        var html = template(data);
        $(targetId).empty();
        $(targetId).html(html);
       
    });
};</pre></body></html>