请问这段javascript代码是什么意思呢? 我发现网页没有它运行不正常, 但是我不懂这段代码是什么意思.
<scriptlanguage="javascript">varshop={languages:{"ab":"Abkhazian","aa":"Afar","af":"A...
<script language="javascript">
var shop = {
languages:{"ab":"Abkhazian","aa":"Afar","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","an":"Aragonese","hy":"Armenian","as":"Assamese","av":"Avaric","ae":"Avestan","ay":"Aymara","az":"Azerbaijani","bm":"Bambara","ba":"Bashkir","eu":"Basque","be":"Belarusian","bn":"Bengali","bh":"Bihari","bi":"Bislama","bs":"Bosnian","br":"Breton","bg":"Bulgarian","my":"Burmese","ca":"Catalan","km":"Central Khmer","ch":"Chamorro","ce":"Chechen","ny":"Chichewa","zh":"Chinese","cu"},
proto:"http://",
domain:"test.com",
promo:false,
lang:{"total":"Total","languagesavailable":"Languages Available","selectlanguage":"Select Language","for":"For","addtocart":"Add to Cart","cancel":"Cancel","update":"Update","continue":"Continue","formfieldrequired":"This field is required","forminvalidemail":"Invalid e-mail address supplied","forminvalidnumber":"Invalid number supplied","formvaluetooshort":"Value is too short"}
};
</script>
请问这段javascript代码是什么意思呢? 我发现网页没有它运行不正常, 但是我不懂这段代码是什么意思.
请给解释一下, 谢谢 展开
var shop = {
languages:{"ab":"Abkhazian","aa":"Afar","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","an":"Aragonese","hy":"Armenian","as":"Assamese","av":"Avaric","ae":"Avestan","ay":"Aymara","az":"Azerbaijani","bm":"Bambara","ba":"Bashkir","eu":"Basque","be":"Belarusian","bn":"Bengali","bh":"Bihari","bi":"Bislama","bs":"Bosnian","br":"Breton","bg":"Bulgarian","my":"Burmese","ca":"Catalan","km":"Central Khmer","ch":"Chamorro","ce":"Chechen","ny":"Chichewa","zh":"Chinese","cu"},
proto:"http://",
domain:"test.com",
promo:false,
lang:{"total":"Total","languagesavailable":"Languages Available","selectlanguage":"Select Language","for":"For","addtocart":"Add to Cart","cancel":"Cancel","update":"Update","continue":"Continue","formfieldrequired":"This field is required","forminvalidemail":"Invalid e-mail address supplied","forminvalidnumber":"Invalid number supplied","formvaluetooshort":"Value is too short"}
};
</script>
请问这段javascript代码是什么意思呢? 我发现网页没有它运行不正常, 但是我不懂这段代码是什么意思.
请给解释一下, 谢谢 展开
2个回答
展开全部
定义了一个js对象 叫shop 有几个属性 languages、proto、domain、promo、lang
其中
languages应该是语言 这个属性的值是 一个json数组"ab":"Abkhazian" 这一个代表一种语言前边是简称后边是全称。它也可以转换为js对象转换后,ab为属性名 Abkhazian为属性值
proto应该是协议,属性值是http://
domain应该域名,属性值是test.com
promo好像是代理吧,属性值为false 应该是没使用代理
lang也是应该是语言的意思,属性值为json数组,但没太看懂,可能是常用短语吧
其中
languages应该是语言 这个属性的值是 一个json数组"ab":"Abkhazian" 这一个代表一种语言前边是简称后边是全称。它也可以转换为js对象转换后,ab为属性名 Abkhazian为属性值
proto应该是协议,属性值是http://
domain应该域名,属性值是test.com
promo好像是代理吧,属性值为false 应该是没使用代理
lang也是应该是语言的意思,属性值为json数组,但没太看懂,可能是常用短语吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询