首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >esi:include src可以用作html页面中的esi变量吗?

esi:include src可以用作html页面中的esi变量吗?
EN

Stack Overflow用户
提问于 2015-08-29 00:28:18
回答 1查看 684关注 0票数 0

示例:

esi:assign和esi:包含在通过akamai cdn呈现的html页面中的问题

代码语言:javascript
复制
http://www.trial.com/abc/def/ghjiy (Akamai rendering src) has content "abc"

In an html page
<esi:include src="http://www.trial.com/abc/def/ghjiy"></esi:include> will return "abc"
can I assign this to a variable so we can use it multiple times in the html  page using 
<esi:vars>$(val)</esi:vars>

I have tried something like this 
<esi:text><esi:assign name="val">'</esi:text><esi:include 
src="http://www.trial.com/abc/def/ghjiy"></esi:include><esi:text>'</esi:assign></esi:text>"

But after html page being rendered the <esi:assign> tags has not been parsed and returned 
the following in page source
<esi:assign name="val">abc</esi:assign>
EN

回答 1

Stack Overflow用户

发布于 2016-08-02 18:33:56

您可以使用esi:eval而不是esi:include

http://www.trial.com/abc/def/ghjiy可能会返回将在边缘计算的esi代码片段。例如:<esi assign name="val">I assign this to a variable so we can use it multiple times in the html page using</esi:assign>

然后,您可以使用<esi:vars>$(val)</esi:vars>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32275704

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档