css 应用 jquery ajax 语法

1:如:下面的resumes.js

function getCurrentTab(id){

//.ad_left_profile_maintitle 是class 用“.”表示$(".className"),在样式stylesheet2.css

如果是有id $("#id")

//

.ad_left_profile_maintitle ul li a.current{

width: 130px;height: 27px;display:block;background: url(../images/profile_main_title1.gif) no-repeat;text-decoration: none;padding-top: 7px;}

//删除(removeClass)这个Class后再加是addClass


    $(".ad_left_profile_maintitle>ul>li>a").removeClass("current");
    $("#"+id+"").addClass("current");
}
function setCurrentTab(id){
    $(".ad_left_menu>ul>li>a").removeClass("current");
    $("#"+id+"").addClass("current");
}

2:如下:

隐藏:$("#buttom_botton").css('display','none'); 是对下面的加或显示$("#buttom_botton").css('display','');

             <div id="buttom_botton">
                    <ul>
                        <li id="save_Item_btn" class="button" style="font-size: 20px;font-weight: bold;">Submit</li>                        
                        <li id="preview_item_btn" class="button" style="font-size: 20px;font-weight: bold;margin-left:50px;">Preview</li>
                    </ul>    
                </div> 
=====================================================

在页面加载数据是用的是 :  在hired my way 有一个cool_places.jsp如下:

<script type="text/javascript">   
function loadItems(){
            $('#compUrl_error').hide();
            var url = 'loadCoolPlacesItems.action';
            $.post(url, TipsGrid.draw);
        }

加载数据是循环数据:

    /**
        * Draw Tips Table
        */
        function TipsGrid() {}
        TipsGrid.tBody = function() {
            return $('#tips_tbody');
        }
        TipsGrid.draw = function(jsonObj) {
            TipsGrid.remove();
            var items = jsonObj.ITEMS;
            for (var i=0; i < items.length; i ++) {
                TipsGrid.drawRow(items[i]);
            }
        }        
        TipsGrid.drawRow = function(item) {            
            var tr = '<tr style="border-bottom: 1px solid #F4F4F4; " id="tip_' + item.id + '">';            
            tr += '<td width="90%">'+
                 '<div id="cool_places_table_items"><ul class="crain_bottom_content_title">' +item.title+'</ul>'+
                     '<ul class="crain_bottom_content_description">'+item.textDesc+'</ul>'+
                     '</div></td>';
            tr += '<td width="10%" ><a href="javascript:editCommonItems(' + item.id + ');">Edit</a>&nbsp;&nbsp;<a href="javascript:deleteCommonItem(' + item.id + ');">Delete</a></td>';
            tr += '</tr>';
            TipsGrid.tBody().append(tr);
            
        }
        //加载完要删除tr
        TipsGrid.remove = function() {
            $('#tips_tbody > tr').remove();
        }

</script>

             <div class="tab-content default-tab" id="tab1">
                <!-- This is the target div. id must match the href of this div's tab -->
                <table>
                    <thead>
                        <tr>
                            <th>
                                Items
                            </th>
                            <th>
                                Actions
                            </th>
                        </tr>
                    </thead>

                    <tbody id="tips_tbody">    
                        <tr>
                        <td colspan="2"> Loading data ... </td>
                        </tr>                            
                    </tbody>

                </table>

            </div>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值