We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 Window 系统中生成的图片 URL 分隔符是反斜杠().
background:url(images\107957.png) no-repeat;
这会造成无法加载背景图片, img 中包含的 URL 也一样有反斜杠, 但浏览器似乎有容错机制.
<img class="layer" src="images\c334bf.png" style="left:48px;top:53px;" width="104" height="106">
分析代码 URL 错误是由于使用了兼容系统的路径拼接造成的
image = path.join(images, flag.slice(1, 7) + '.png');
Linux 和 Window 分别采用了不同的路径分隔符(正斜杠和反斜杠), 因此会生成的不同的 URL.
d:\window\b\c root/linux/b/c
为了避免跨平台问题, 还是直接拼接 URL 好了
image = images + '/' + flag.slice(1, 7) + '.png';
修改代码后的效果, URL 正常了
The text was updated successfully, but these errors were encountered:
9fc8f1c
Merge pull request #2 from ufologist/patch-1
ae86a14
Fixes #1
感谢反馈和修正
Sorry, something went wrong.
fixed: Windows path to url. issues: #1
b5cb6c3
No branches or pull requests
在 Window 系统中生成的图片 URL 分隔符是反斜杠().
这会造成无法加载背景图片, img 中包含的 URL 也一样有反斜杠, 但浏览器似乎有容错机制.
分析代码 URL 错误是由于使用了兼容系统的路径拼接造成的
Linux 和 Window 分别采用了不同的路径分隔符(正斜杠和反斜杠), 因此会生成的不同的 URL.
为了避免跨平台问题, 还是直接拼接 URL 好了
修改代码后的效果, URL 正常了
The text was updated successfully, but these errors were encountered: