第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

不重復(fù)的報(bào)價(jià)生成器不起作用

不重復(fù)的報(bào)價(jià)生成器不起作用

桃花長(zhǎng)相依 2023-09-07 18:25:39
您好,我想使用 RandomQuoteGenerator 腳本,我在 stackoverflow 上找到了一個(gè)腳本,但我希望它不重復(fù)引號(hào),我在這里找到了一個(gè)解決方案,但它對(duì)我不起作用。單擊按鈕時(shí)出現(xiàn)未定義的錯(cuò)誤。上面鏈接中提供的原始腳本工作正常,但如果我更改上面鏈接中提到的函數(shù),我將收到未定義的消息而不是引號(hào)。我的 Generator.jsvar quotes = [//success quotes  {    quote: "If you set your goals ridiculously high and it's a failure, you will fail above everyone else's success.",    source: "James Cameron",    tag: "success"  },  {    quote: "The Way Get Started Is To Quit Talking And Begin Doing",    source: "Walt Disney",    tag: "success"  },  {    quote: "Don’t Let Yesterday Take Up Too Much Of Today.",    source: "Will Rogers",    tag: "success"  },  {    quote: "We Generate Fears While We Sit. We Overcome Them By Action",    source: "Dr. Henry Link",    tag: "success"  },//health quotes  {    quote: "Early to bed and early to rise, makes a man healthy wealthy and wise.",    source: "Benjamin Franklin",    tag: "health"  },  {    quote: "Let food be thy medicine and medicine be thy food.",    source: "Hippocrates",    tag: "health"  },  {    quote: "If you can’t pronounce it, don’t eat it.",    source: "Common Sense",    tag: "health"  },  {    quote: "Health is like money, we never have a true idea of its value until we lose it.",    source: "Josh Billings",    tag: "health"  },//spirituality quotes  {    quote: "Life is really simple, but men insist on making it complicated.",    source: "Confucius",    tag: "spirituality"  },  {    quote: "My religion is very simple. My religion is kindness.",    source: "Dalai Lama",    tag: "spirituality"  },  {    quote: "Knowing others is wisdom; knowing the self is enlightenment.",    source: "Tao Te Ching",    tag: "spirituality"  },  {    quote: "When there is love in your heart, everything outside of you also becomes lovable.",    source: "Veeresh",    tag: "spirituality"  }];
查看完整描述

1 回答

?
POPMUISE

TA貢獻(xiàn)1765條經(jīng)驗(yàn) 獲得超5個(gè)贊

您的函數(shù)getRandomQuote()返回一個(gè)數(shù)組,因此為了訪問(wèn)該對(duì)象,您需要訪問(wèn)該數(shù)組的第一個(gè)元素。像這樣...

getQuote[0].quote


查看完整回答
反對(duì) 回復(fù) 2023-09-07
  • 1 回答
  • 0 關(guān)注
  • 125 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)