[英]Can I use a php embed inside a javascript for my mobile website?
I have a javascript that displays a message on a mobile website in a drop-down bubble. 我有一个JavaScript,可在移动网站上的下拉气泡中显示消息。 I also have a lightweight cms that generates simple html files that I use to update portions of the website.
我也有一个轻量级的cms,可以生成简单的html文件,用于更新网站的某些部分。 I use php embed to pull the text from the CMS into the mobile web page.
我使用php embed将文本从CMS拉到移动网页中。
I would like to use the cms to update the text that is inside the drop-down bubble, but it seems to break the javascript when I do. 我想使用cms更新下拉气泡内的文本,但是这样做似乎破坏了javascript。 Is there a way to accomplish my intended goal?
有没有办法实现我的预期目标?
Here is the javascript snippet, minus the script brackets: 这是javascript片段,减去脚本括号:
var addToHomeConfig = {
message2: "REPLACE THIS TEXT WITH .HTML FILE FROM CMS",
message:"Featuring LIVE MUSIC on Thursdays. See our EVENTS menu for schedule.",
textcolor: "#ffffff",
bgcolor: "#69532f",
returningVisitor: true,
animationIn: "drop",
animationOut: "fade",
startDelay:5000,
lifespan:10000,
expire:240,touchIcon:true};
This is a sample of my embed code and the resulting HTML page. 这是我的嵌入代码和生成的HTML页面的示例。 This would replace the "REPLACE THIS TEXT..." part of the snippet above.
这将替换上面代码段中的“替换此文本...”部分。
<?php include("admin/data/blocks/Special-of-the-Day.html"); ?>
The content of this html file is: 该html文件的内容为:
<p>Come down and enjoy Andrea Wirth on the patio between 7pm and 9pm.</p>
您不能在客户端使用服务器端脚本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.