小编Ras*_*med的帖子

获取URL中的搜索文本值

我有这样的表格

<form method="get" id="searchform" action="http://domain.com">
    <input name="s" id="s" type="text" />
    <input type="submit" id="searchsubmit" type="submit" />
</form>
Run Code Online (Sandbox Code Playgroud)

当我在搜索输入文本中添加一些关键字时,该URL将显示为http://domain.com/?s=keyword

我需要它作为http://domain.com/?s=keyword&post_type=events

意味着我只需要在url上添加&post_type = event.我该怎么做?有什么建议吗?

php wordpress

3
推荐指数
1
解决办法
300
查看次数

SyntaxError:let是firefox上的保留标识符

我在下面使用这些代码

'use strict';

jQuery(document).ready(function($) {
    function CMB2ConditionalsInit(context) {
        if(typeof context === 'undefined') {
            context = 'body';
        }

        $('[data-conditional-id]', context).each(function(i, e) {
            var $e = $(e),
                id = $e.data('conditional-id'),
                value = $e.data('conditional-value');

            var $element = $('[name="' + id + '"]'),
                $parent = $e.parents('.cmb-row:first').hide();

            $e.data('conditional-required', $e.prop('required')).prop('required', false);

            $element
                .on('change', function(evt){
                    let conditionValue = CMB2ConditionalsStringToUnicode(evt.currentTarget.value);

                    if(typeof value === 'undefined') {
                        CMB2ConditionalToggleRows('[data-conditional-id="' + id + '"]', ($element.val() ? true : false));
                    } else {
                        CMB2ConditionalToggleRows('[data-conditional-id="' + id + '"]:not([data-conditional-value="' + conditionValue + '"])', false); …
Run Code Online (Sandbox Code Playgroud)

javascript firefox

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

简单的PHP选择选项编程

我在php select选项中有一个简单的问题.

该页面有5个选择选项和提交按钮.当我选择一个选项时,它应该在特定的网页上.例如:http://onlinetools.org/tricks/using_multiple_select.php

然后我选择一个选项并按发送,然后显示我选择的选项.但我需要去特定的网页.

我试过这个代码,但我失败了......

<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<select name="test[]" multiple="multiple">
    <option value="http://google.com">one</option>
    <option value="http://yahoo.com">two</option>
    <option value="http://facebook.com">three</option>
    <option value="http://who.is">four</option>
    <option value="http://myspace.com">five</option>
</select>
<input type="submit" value="Send" />
</form>




<?php
    $test=$_POST['test'];
echo "
<script type=\"text/javascript\">
window.location = \"$test\"
</script>

    ";
?>
Run Code Online (Sandbox Code Playgroud)

有人可以帮帮我吗?

php

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

Tympanus Elastislide Carousel自动播放

我在我的网站上使用鼓膜Elastislide Carousel Responsive jQuery插件.该插件在我的网站上完美运行.但是,我希望casousel会自动播放.

但是,我没有找到任何自动移动轮播的代码.

Slider Plugin链接:http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/

我正在使用的java脚本

<script type="text/javascript">

    $( '#carousel' ).elastislide( {

    // orientation 'horizontal' || 'vertical'
    orientation : 'horizontal',

    // sliding speed
    speed : 500,

    // sliding easing
    easing : 'ease-in-out',

    // the minimum number of items to show.
    // when we resize the window, this will make sure minItems are always shown
    // (unless of course minItems is higher than the total number of elements)
    minItems : 3,

    // index of the current …
Run Code Online (Sandbox Code Playgroud)

jquery

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

所有div的jQuery选择器

我有这样的div

<div id="gallery-1"></div>
<div id="gallery-2"></div>
<div id="gallery-3"></div>
<div id="gallery-4"></div>
<div id="gallery-5"></div>
Run Code Online (Sandbox Code Playgroud)

如何在一个jquery选择器中选择它们?喜欢

jQuery("#gallery-*").something();
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

jquery

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

标签 统计

jquery ×2

php ×2

firefox ×1

javascript ×1

wordpress ×1