Skip to content

Instantly share code, notes, and snippets.

View hudidit's full-sized avatar
🕹️
Learning

哈哈胡子 hudidit

🕹️
Learning
  • Hangzhou,China
View GitHub Profile
<script src="jquery.js"></script>
<script src="jquery.colorbox.js"></script>
<script> window.colorbox_css_url = "path/to/colorbox.css"; </script>
<script src="my.js"></script>
上面的 HTML 代码都是在 PHP 里面 echo 出来的。
第3行可能和问题无关,但是我不确定,所以也贴出来了。写第3行是因为:
我要在 my.js 里面把 <link href="path/to/colorbox.css"/> 添加到 head 里,
但是用相对路径就出错,我就把绝对路径用 PHP 输出在 HTML 里面了,然后绑在 window 上。