【发布时间】:2012-02-11 00:45:09
【问题描述】:
我正在搜索代码拆分。我想要一个链接,首先单击运行 MySQL 查询并更改链接。
我找到了这个,但只是更改文本:
<script type="text/javascript">
$(document).ready(function() {
// hides the slickbox as soon as the DOM is ready
// (a little sooner than page load)
$('#slickbox').hide();
// toggles the slickbox on clicking the noted link
$('a#slickbox-toggle').click(function() {
$('#slickbox').slideToggle(400);
return false;
});
});
</script>
$(this).text($(this).text() == 'Show box' ? 'Hide box' : 'Show box');
示例: Facebook 喜欢按钮 =>
赞(56 个赞)
点击(更新点赞…………点赞数+=1) 不喜欢(57 个喜欢)
我该怎么做?
【问题讨论】:
标签: javascript jquery html ajax dhtml