小编sea*_*987的帖子

php数组next()和prev()

我有一个看起来像这样的数组,

    Array
(
    [0] => 849710414
    [1] => 849710726
    [2] => 849710744
    [3] => 849712728
    [4] => 849713005
    [5] => 849713439
    [6] => 849714856
    [7] => 849714924
    [8] => 849716371
    [9] => 849716441
    [10] => 849717118
    [11] => 849719043
    [12] => 849719187
    [13] => 849722865
    [14] => 849723412
    [15] => 849723777
    [16] => 849725052
    [17] => 849726294
    [18] => 849726457
    [19] => 849726902
    [20] => 849728239
    [21] => 849728372
    [22] => 849728449
    [23] => 849730353
    [24] => 849733625
)
Run Code Online (Sandbox Code Playgroud)

这些是我需要添加到URL以在网站中导航的ID,ID是从用户的搜索返回的结果,然后用户点击搜索结果并且可以选择转到下一个搜索结果看看前一个,现在我虽然通过这样做可以做到这一点 …

php arrays codeigniter

1
推荐指数
1
解决办法
2万
查看次数

PHP数组有助于从密钥中获取值

我有一个看起来像这样的变量,

$rslt['expected_salary_level']
Run Code Online (Sandbox Code Playgroud)

这将返回一个类似于LEVEL_3的字符串,在另一个看起来像这样的数组中我有一组工资,

    Array
(
    [LEVEL_1] => Array
        (
            [nice_name] => under £10,000
            [low] => 1
            [high] => 10000
        )

    [LEVEL_2] => Array
        (
            [nice_name] => £10,000 - £15,000
            [low] => 10000
            [high] => 15000
        )

    [LEVEL_3] => Array
        (
            [nice_name] => £15,000 - £20,000
            [low] => 15000
            [high] => 20000
        )

    [LEVEL_4] => Array
        (
            [nice_name] => £20,000 - £25,000
            [low] => 20000
            [high] => 25000
        )

    [LEVEL_5] => Array
        (
            [nice_name] => £25,000 - £30,000
            [low] => 25000 …
Run Code Online (Sandbox Code Playgroud)

php arrays

0
推荐指数
1
解决办法
185
查看次数

php foreach从数组中获取值

我在访问数组中的值时遇到问题,数组看起来像这样,

Array
(
    [0] => Array
        (
            [id] => 1661
            [code] => 849651318
            [job_status] => 4
            [looking_for] => Lorem ipsum
            [keywords_education] => Derby University
            [sector_id_csv] => 10,21,9,22,26
            [last_job_title_1] => Programmer
            [last_job_employer_1] => HBOS
            [city] => Bury
            [expected_salary_level] => LEVEL_2
            [education_level] => COLLEGE
            [job_looking_for] => 
            [is_contract] => Y
            [is_permanent] => N
            [is_temporary] => Y
        )

)
Array
(
    [0] => Array
        (
            [id] => 402
            [code] => 849650059
            [job_status] => 3
            [looking_for] => Lorem ipsum
            [keywords_education] => Paris College
            [sector_id_csv] => …
Run Code Online (Sandbox Code Playgroud)

php arrays foreach loops multidimensional-array

0
推荐指数
1
解决办法
2万
查看次数

jquery removeClass()

是否可以删除不等于某个字符串的所有元素类,

例如,如果我有以下HTML


<a href="" class="status pending"></a>
<a href="" class="status successful"></a>
<a href="" class="status unsuccessful"></a>

我可以删除所有不等于status的类吗?

javascript jquery

0
推荐指数
2
解决办法
1290
查看次数

圆角没有javascript或css3

我有一个导航菜单,其中链接的悬停状态如下所示,

在此输入图像描述

如您所见,橙色背景上有圆角背景.客户已要求通过IE6正常工作(他们还没有升级的阶段).现在我最近进入了网络开发,所以我还没有学到实现这种效果的旧技术可以请一些启发我吗?下面是我的代码,目前我正在使用CSS3.

#navPrimary {
        background:#de4702;
        height:37px;
        margin:0px auto;
        width:517px;
        padding:5px 0px 0px 0px;
        display:block;
        overflow:hidden;
    }

        #navPrimary li {
            width:252px;
            float:left;
            display:block;
            height:100px;
            list-style-type:none;
            text-align:center;
            margin:0px 0px 0px 8px;
        }

            #navPrimary li.first {
                width:67px;
                padding:0px 14px 0px 14px;
                display:block;
                margin:0;
            }

            #navPrimary .last {
                width:154px;
            }

            #navPrimary li a {
                color:#fff;
                font-weight:bold;
                text-decoration:none;
                display:block;
                height:27px;
                padding:10px 0px 0px 0px;

            }

                #navPrimary li a:hover {
                    color:#de4702;
                    background:#fff;
                    -moz-border-radius:10px 10px 0px 0px;
                    -webkit-border-radius:10px 10px 0px 0px;
                    border-radius:10px 10px 0px 0px;
                }

<ul …
Run Code Online (Sandbox Code Playgroud)

html css rounded-corners

0
推荐指数
1
解决办法
1450
查看次数

jquery帮助next()函数

我有一些看起来像这样的HTML标记,

        </a>
        <nav>
            <ul>
                <li><a href=""><img src="/media/icons/view.jpg" alt="Views"/> 210</a></li>
                <li><a href=""><img src="/media/icons/like.jpg" alt="Likes"/> 45</a></li>
                <li class="jobs"><a href="">52 New Jobs</a></li>
            </ul>
        </nav>
        <ul class="job_listings">
            <li><a href="">Outbound Telesales Assistant &gt;</a></li>
            <li><a href="">Business Development Manager &gt;</a></li>
        </ul
    </li>
Run Code Online (Sandbox Code Playgroud)

.job_listings隐藏DOM的准备,需要进行节目时li.jobs a点击的是,我有一个具有以下,jQuery的尝试这样做:

$('#jobwall .jobs a').click(function(){
                $(this).next('.job_listing').show();
                return false;
            });
Run Code Online (Sandbox Code Playgroud)

javascript jquery dom-manipulation show-hide

0
推荐指数
1
解决办法
1019
查看次数

无法访问JSON

我有这个ajax请求,

$.ajax({
    url    : '<?php echo current_url(); ?>',
    data       : "txtKeywords="+$("#txtKeywords").val()+"&search=Search For Item",
    type       : 'POST',
    dataType   : 'JSON',
    success : function(html)
    {       
        console.log(html);          
    }
});
return false;
Run Code Online (Sandbox Code Playgroud)

我在我的控制台中得到以下内容,

[{"productId":"5","productTitle":"Small Brasserie Dining Table","productPath":"small-brasserie-dining-table\/","productRangeId":"6","productSecondaryRangeId":"0","productTypeId":"2","productRefNo":"0080","productShortDesc":"","productBestSeller":"0","productFeatured":"0","productIsSet":"0","productPrice":"275","productSavingType":"none","productSavingPrice":"0","productSavingMessage":"","productDimWidth":"90","productDimHeight":"74","productDimDepth":"90","productTechnical":"Powder coated aluminium frame with welded joints.","productTemplateId":"5","productMetadataTitle":"","productMetadataKeywords":"","productMetadataDescription":"","productBandingColour":"grey","productActualPrice":"275","rangeTitle":"Dining","parentRangeTitle":"Aegean","fullRangePath":"aegean\/dining\/","fullProductPath":"aegean\/dining\/small-brasserie-dining-table\/","hasImage":"0"}]
Run Code Online (Sandbox Code Playgroud)

但是,当我做的事情,

alert(html.productTitle)
Run Code Online (Sandbox Code Playgroud)

我得到的都是未定义的?

我做错了什么?j

javascript ajax jquery json

0
推荐指数
1
解决办法
95
查看次数