我正在嘗試從站點獲取其他信息,并且有隨機定義的變量/數組。喜歡這個:var firstvar_numbers= "already exist"var secondvar_numbers= ["a","b","c","d"]數字是由站點給出的隨機值。在 firefox DOM 中,當我編寫一半時,立即發現我想要,因為只有一個變量以 .我的問題是,如何通過了解變量的一部分,在 userscript/javascript 中獲取變量的值/數組。如果您不理解的示例: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控制臺中編寫,它將推薦自動編譯。alert(exists_)
如果我不知道javascript中的完整變量名稱,如何查找變量/數組
至尊寶的傳說
2022-08-27 09:33:31