日期:2014-05-16  浏览次数:20463 次

jQuery动态加载js,设置cookie

jQuery动态加载js,设置cookie

var sy = $.extend({}, sy);/* 全局对象 */
alert($.cookie('easyuiLanguageName'));

sy.changeLanguage = function(languageName) {/* 更换语言 */
	var src='/picc_epp/js/jquery-easyui-1.2.6/locale/easyui-lang-'+ languageName + '.js';
	console.info(src);
	$.cookie('easyuiLanguageName', languageName, {
		expires : 7
	});
	
	$.getScript(src);
};

if ($.cookie('easyuiLanguageName')) {
	sy.changeLanguage($.cookie('easyuiLanguageName'));
}else{
	sy.changeLanguage('en');
}

?