我正在嘗試從站點(diǎn)獲取其他信息,并且有隨機(jī)定義的變量/數(shù)組。喜歡這個(gè):var firstvar_numbers= "already exist"var secondvar_numbers= ["a","b","c","d"]數(shù)字是由站點(diǎn)給出的隨機(jī)值。在 firefox DOM 中,當(dāng)我編寫一半時(shí),立即發(fā)現(xiàn)我想要,因?yàn)橹挥幸粋€(gè)變量以 .我的問題是,如何通過了解變量的一部分,在 userscript/javascript 中獲取變量的值/數(shù)組。如果您不理解的示例:Htmlsecondvar_second//Variable that I need from server<div id="variables" class="container"><script type="text/javascript">var exists_73647286="hello world"var array_636353=[62,96,11,28]</script></div>Javascript//Code that will get arrayalert("exists_"+seconpartofvar())function seconpartofvar(){your code}或alert(autocomplate.exists_)在這里,我可以在Firefox控制臺(tái)中編寫,它將推薦自動(dòng)編譯。alert(exists_)
如果我不知道javascript中的完整變量名稱,如何查找變量/數(shù)組
至尊寶的傳說
2022-08-27 09:33:31
