我想知道是否有更好的方法来存储html内容中的数据.
目前,我使用隐藏字段将一些值存储在我的html文件中.这些值由后面的代码生成.
HTML:
<input type="hidden" id="hid1" value="generatedValue1" />
<input type="hidden" id="hid2" value="generatedValue2" />
Run Code Online (Sandbox Code Playgroud)
因此,我使用jquery在客户端获取这些值,以便将它们传递给ajax请求.
JQuery的
$.ajax({
data:{
var1 : $('#hid1').val(),
var2 : $('#hid2').val()
}
);
Run Code Online (Sandbox Code Playgroud)
这是正确的方法吗,还是存在更平滑的解决方案来实现相同的结果?由于我不需要在页面上提交这些值,因此input hidden可能是粗略的.
我有一个简单的按钮,我试图添加一个glyphicon以获得时尚.
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-8">
<div class="container-fluid">
<div class="form-group">
<button class="btn btn-primary form-control">
Test
<span class="pull-right">
<span class="glyphicon glyphicon-edit">
</span>
</span>
</button>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
虽然它在chrome和safari上完美运行,但是glyphicon在mozilla上的位置很差.是否有一个众所周知的问题,或者我是否在使用bootstrap css做错了什么?
如果你想要确切地看到我想要获得的东西(在chrome上),以及什么是错误的(在mozilla上),这就是plunker.