简体   繁体   English

js弹出窗口未显示html标签

[英]js popup is not showing html tags

I created this test page strutmymutt.com/rescues/test for sorting out 2 things. 我创建了此测试页面strutmymutt.com/rescues/test来整理两件事。 First, when you click on "testing the html in js popup", popup is not missing the html part. 首先,当您单击“在js弹出窗口中测试html”时,弹出窗口不会缺少html部分。 This is the content I put for popup. 这是我放入弹出窗口的内容。

$a="Please add the dog first to make status updated, upload videos and photos or select the default dog.<br /><br /><a href='" . Phpfox::getLib('url')->makeUrl('dogs.add') . "'>Add  a Dog</a><br />";

2nd issue, I need to put footer at some fixed height if page content is shorter and for longer page, footer is fine. 第二个问题,如果页面内容较短,而页面较长,则页脚就可以了。

Comment: please provide the surrounding JavaScript to clarify that you don't mean you are using alert vs. some function from a framework. 评论:请提供周围的JavaScript,以说明您使用的不是警告,而是框架中的某些功能。

Javascript alert doesn't typically support html tags. Javascript警告通常不支持html标签。 Use a hidden div and jquery.toggle or .show() / .hide() to manage it. 使用隐藏的div和jquery.toggle或.show()/ .hide()进行管理。 That way you can display html in your popup. 这样,您可以在弹出窗口中显示html。

Edit: Bootstrap popups do support html, so showing your surrounding code in a more thorough example will be a good way to enable others to help troubleshoot. 编辑: Bootstrap弹出窗口确实支持html,因此在更详尽的示例中显示您的周围代码将是使其他人帮助进行故障排除的好方法。

It seems that your HTML tags are stripped away. 您的HTML标记似乎已被剥离。 Make sure that your $a variable is passed as it is to your popup and that it's not modified by stip_tags($a) or similar. 确保将$ a变量原样传递到弹出窗口,并且不要被stip_tags($ a)或类似变量修改。

2nd: have a look at "sticky footer", this should solve your problem: http://www.cssstickyfooter.com/ 第二:看看“粘性页脚”,这应该可以解决您的问题: http : //www.cssstickyfooter.com/

为什么还要使用js创建弹出窗口。我想您必须使用CSS3技巧来创建弹出窗口。像这样: CSS3 Popup示例 ..您可以按照此处的教程创建类似的东西

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM