可能重複:
Is it possible to pass GET or POST variable to external javascript是否有可能通過GET或POST變量外部JavaScript
我想知道是否有可能任何變量傳遞給外部 Java的腳本文件
例如
我這個
<script type="text/javascript" src="gallery.js"></script>
我想知道如果有可能將參數傳遞到該腳本文件,如果是這樣,我怎麼在外部文件看懂了嗎?也許這樣的東西:???
<script type="text/javascript" src="myscript.js?id=123"></script>
謝謝
這段代碼(firefox 30.0下)有一個Invalid Quantifier錯誤,我需要在`s.replace`的參數中使用反斜槓來轉義`?`。 – Quentin 2014-07-29 13:10:20