是否有可能使锚标记的行为类似于.submit(具有某些帖子特征?)为什么我有一个锚标记,因为我不喜欢提交按钮外观并想要一个CSS按钮.
这就是我现在正在做的事情(而且它不起作用)
html文件
<div class="footer"><a href="#" id = "test_btn" class="button"><strong>Sign Up</strong></a></div>
<div class="footer"><a href="#" id = "test2_btn" class="button"><strong>Sign Up</strong></a></div>
Run Code Online (Sandbox Code Playgroud)
.js文件
<script type="text/javascript">
$("#test_btn").live("click",function(){
var post_data = {'account_type':"Free"}
return $.post("www.someplacehere.com/user_sign_up/1/", post_data);
});
$("#test2_btn").live("click",function(){
var post_data = {'account_type':"Premium"}
return $.post("www.someplacehere.com/user_sign_up/1/", post_data);
});
</script>
Run Code Online (Sandbox Code Playgroud)
我得到了一个正确的响应,但它没有将我发送到POST数据页面只是重定向回到页面顶部(由于锚点).任何想法如何让它指向正确的位置(html页面)与POST数据预先填写在该html页面上?如你所知,这并不简单.submit().现在可能会去一个隐藏的领域,然后做一个.submit(),但想知道是否有一个更简单的方式来获取页面,因为POST可以正常完成.
谢谢!
Bra*_*ace 23
每个人都停止重新发明按钮.它们已经存在,它们也可以被设计.
button[type=submit] {
background-color: transparent;
border: none;
border-bottom: solid blue 1px;
color: blue;
font-weight: bold;
padding: 0px;
cursor: pointer;
}
Run Code Online (Sandbox Code Playgroud)
在这里演示:http://jsfiddle.net/MZbLW/
我还应该指出,世界上的每个人都会在表格末尾寻找传统按钮,从可用性的角度来看,使它看起来完全不同可能不是最好的主意.
| 归档时间: |
|
| 查看次数: |
14175 次 |
| 最近记录: |