首页
博客
文章
美图
笔记
管理后台
引用变量的格式 ${variable}
chen
1次查看
Tags:
在html中的像下面函数的content参数内容往往很长,一般要么不分行,可读性很差,如果代码要分行显示,所有内容要用\` `反引号来包裹,像书中P255用 '+varialbe+' 的旧格式将不被识别,只能做一般字符串,必须用新格式 ${variable}。强烈推荐用新格式,易读性好不会出错。 ```html function displayImage(user, title, url, description, host){ layer.open({ type: 1, title: title, skin: "layer-ext-demo", area: ['600px', '500px'], content: `<div class="text-center"> <img src="https://${host}${url}" style="max-width: 100%; max-height: 400px;"> <p>发布者: ${user}</p></div> <div style="margin-left:10px; margin-top: 10px;">${description}</div>`, }); } ```
网站已永久关闭评论和点赞功能
最受欢迎文章
生成SSL证书(ca + server)
局域网内其他IP访问VM中ubuntu下django服务器
配置Nginx同时支持HTTP和HTTPS
数据迁移失败-手动增加字段
P244页实现删除课程,但确认框带网址
安装Redis数据库
最新文章
生成SSL证书(ca + server)
配置Nginx同时支持HTTP和HTTPS
局域网内其他IP访问VM中ubuntu下django服务器
数据迁移失败-手动增加字段
最多评论文章
安装Redis数据库
代码./article/views.py
+文章标签
推荐相似文章
暂无相似文章
copy right potatotime.top