- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 HTML 表单。当您单击提交按钮时,它会将框中的数据存储到一个表中,然后显示一条消息。消息从 PHP 文件发送,然后由 HTML 文件中的 js 显示。问题是消息有 br
其中的标签,当显示消息时,它显示 <br>
标记而不是断行。
这是我测试它的地方 - http://ft5.cu.cc/单击心形 Logo 以查看表格。
HTML 格式
<div class="contact">
<form method="post" action="daalo.php">
<input type="text" maxlength="30" class="text" name="ign" id="ign" placeholder="Please type your IGN(In Game Name)" required="required"/>
<input type="email" maxlength="30" class="required email" name="email" id="email" placeholder="Please type your email" required="required"/><span class="status"></span>
<table width="100%">
<tr>
<td><input type="text" maxlength="30" class="text" id="steamid" name="steamid" placeholder="Enter your Steam ID" required="required"/></td>
<td><span class="status">
<img id="tick" alt="Good"src="images/tick.png" width="16" height="16"/></td>
</tr>
</table>
<span id="cross">Steam Id Already Added</span>
</span>
<input type="submit" name="register" id="register" value="Submit" disabled="disabled" />
</form>
<div id="loading">Processing your <b>WHITELIST</b> entry....</div>
<div id="success"></div>
</div>
*Php 插入*
<?php
include('connecti.php'); //Ganja Login
// Check connection
if (mysqli_connect_errno())
{
echo 'Failed to connect to MySQL: ' . mysqli_connect_error();
}
//Insert
$lab1='IGN<br>';
$lab2='Email ID<br>';
$lab3='Steam ID<br>';
$lab4='Submitted.';
$lab5='Whitelist is updated everyday at 8pm (UTC+01:00) Brussels, Copenhagen, Madrid, Paris.';
$sql="INSERT INTO rusty_whitelist (name, email, steamid) VALUES ('$_POST[ign]','$_POST[email]','$_POST[steamid]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo $lab1;
echo $lab2;
echo $lab3;
echo $lab4;
echo $lab5;
mysqli_close($con);
?>
Java 脚本
(function($) {
$('form').submit(function(e){
var thisForm = $(this);
e.preventDefault();
$(this).fadeOut(function(){
$("#loading").fadeIn(function(){
$.ajax({
type: 'POST',
url: thisForm.attr("action"),
data: thisForm.serialize(),
success: function(data){
$("#loading").fadeOut(function(){
$("#success").text(data).fadeIn();
});
}
});
});
});
});
$('.md-trigger').tipsy({gravity: 's'});
})(jQuery);
$(function(){
$().ready(function() {
$('#videobg').tubular({videoId: 'tDvBwPzJ7dY'}); // where idOfYourVideo is the YouTube ID.
});
});
最佳答案
我认为问题在于您如何在代码中使用 Ajax 返回的值。尝试使用 .html()
方法,而不是使用 jQuery .text()
方法。
关于javascript - Php echo 显示 br 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22210264/
我们的 CMS 将换行符输出为 (愚蠢,我知道,但在语法上是正确的(?)) 这转换为 在 chrome 和 IE10 中到 在火狐中。 所有浏览器都将其显示为两个换行符。 为什么不是翻译成或者只是
我正在尝试将一堆 HTML 文档转换为 XML 合规性(通过 java 方法),并且有很多 (1) 未封闭或 (2) 包含属性的标签。由于某种原因,我使用的正则表达式无法处理包含属性的标签。这是代码
如何转换字符串 "" to "" using java's String.replaceAll(String, String) method? 我都试过了: str.replaceAll("+
这个问题的答案是 community effort 。编辑现有答案以改进这篇文章。它目前不接受新的答案或交互。 我试过检查 other answers ,但我仍然感到困惑——尤其是在看到 W3scho
问题是我无法通过生产者脚本将消息发送到集群内的任何代理。 该设置是一个单一的 Zookeeper 服务器,使用默认设置在 IP (192.168.10.2:2181) 上运行。 此外,还有 3 个代理
我正在尝试使用 python 和 Beautiful Soup 4 用新行替换某些 html 中的每个中断标记。 该文档有 , 和标签,但由于 Beautiful Soup 处理标签的方式,每当它找到
我正在使用带有模板工具包的 perl 生成网页,我在 HTML 文件上更改了一些 JS 代码,编辑后有 显示在 UI 上,我不知道如何,奇怪的是没有 源码中,只有在Inspect element On
这是 HTML 页面的完整源代码: one two three four 谁能解释一下为什么我在IE8或chrome浏览页面时,“三”和“四”之间多了一个空行? 我认为标准应该让所有
我正在使用 并且它按预期在 chrome 和 IE 中正常工作,但在 firefox 中结果很奇怪。当我在 firefox 中看到代码时,它替换了 与 . 我还在某处读到替代语法 XML 允许在许
我有将 BBCode 替换为 html 的代码,当我想替换标签时出现问题 或 [br /]在 [pre=html] code [/pre] 内. Regex exp; string str; str
这个问题不太可能对任何 future 的访客有帮助;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于互联网的全局受众。如需帮助使这个问题更广泛适用,visit the h
我正在使用这个(jQuery)来替换所有 与清除验证错误: $("").replaceAll(""); 但它不会减少任何验证错误。验证器是否检查原始来源? 最佳答案 JQuery 仅在文档呈现后才
我想获取 break html 中的文本,但这不是用段落换行,只是break内的文本。 Division 是我唯一的标识符,它是“Msg”。我怎样才能获得每个元素之一? H
Hood switch - (automatic transmission only).<br><br>Hood Switch (2013 CX-5 - not requir
我想选择 br 后面没有跟另一个 br 的元素。 例如。 sometextadsf 我想选择这两个元素。 sometextadsf 我只想选择 2 个 br 元素,而不是 4 个。 我看过这个问题,但
这个问题在这里已经有了答案: HTML 5: Is it , , or ? (18 个答案) 关闭 9 年前。 当我开始从 w3schools 学习 HTML 时,他们正在使用这个 .当我开始学习
我是 nagios 新手,我已经在我的 Linux 机器上安装了 nagios 3。 我想安装 nagios check_procs 插件。有人可以建议我吗。谢谢 最佳答案 您可以从依赖于您使用的 L
我有一个段落有一些单一的 和双 . 我想添加所有单个 , 但不是双 . 这怎么可能? 如果我用 p br {display:none} 它隐藏了所有的 br 标签。但是,当我有两个 br 时,我希
之间的主要区别是什么?和 在 html 标记中?有人可以解释两者的主要区别,因为这让我感到困惑。预先感谢您的所有评论。 :) 最佳答案 在实践中,不存在。就或 . 但是,区别在于位置,并且对所有
我如何使用JavaScript来检测 成为一个 ? 我试过: jQuery('body').html().replace(/(\\r\n){3, }/g,"\n"); 但这对我不起作用。 最佳
我是一名优秀的程序员,十分优秀!