惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
月光博客
月光博客
WordPress大学
WordPress大学
C
Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
The Cloudflare Blog
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
小众软件
小众软件
H
Heimdal Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
W
WeLiveSecurity
量子位
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Fortinet All Blogs
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
NISL@THU
NISL@THU
Forbes - Security
Forbes - Security
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
S
Security Affairs
V2EX - 技术
V2EX - 技术
TaoSecurity Blog
TaoSecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
宝玉的分享
宝玉的分享
Project Zero
Project Zero
The Hacker News
The Hacker News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
PCI Perspectives
PCI Perspectives
G
GRAHAM CLULEY
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
S
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 聂微东

博客园 - 豆豆の爸爸

IDEA 2024的零卡死配置 10分钟揭秘大模型的原理 苹果容器Apple container是做什么用的? pnpm 10.14 支持JavaScript运行时的安装了 白话Docker:用Web应用实例深入容器 用 rake 合并多个 JS 文件,并且用 Google Closure Compiler 压缩代码 HTML 5 就是 Web Application JS程序员的一天 Google Map 类实例在类式继承中的实现 写入 cookie 的过期时间时在GMT或UTC时间格式上的兼容问题 “当 HTML 5 来敲门”专题沙龙(上海)活动 Google Maps(Google 地图) V3 在 IE7 浏览器中拖放其容器时图块被覆盖的 bug 2010年我的个人总结 [译]用 Closure Compiler 编写更好的 OO 的 JavaScript 使用 IronScheme 进入 Scheme 编程语言的世界 - 豆豆の爸爸 《JS高级程序设计(第2版)》书评 [译]在 Firebug 中的表格化日志 在 Notepad++ 运行 Closure Linter 来校验JS代码 在 Notepad++ 运行 Closure Compiler 工具来解析并压缩JS
PHP 的 Smarty 模板页中分离JS并避开literal标签的解决方法
豆豆の爸爸 · 2011-02-25 · via 博客园 - 豆豆の爸爸

在 Smartry 模板中,如何分离而做到避开{literal}呢?

本人的解决方法是:

在<script>标签中先定义一部分用包含了{}符号的JS变量。示例如下:

<script type="text/javascript">
var __URL = "{$DOMAIN['LOCAL_DOMAIN']}",
   areaInfo = {$areaInfo},
   widgetID = "{$widgetID}";
</script>

然后,再引用后面的JS文件:

<script type="text/javascript" src="{$DOMAIN.JS_DOMAIN}person_map/index.js"></script>

这样,后端与前端可以同时开发,tpl 模板文件只作为了前后端之间公共的部分。

(完)