小编bai*_*772的帖子

如何在ajax上初始化selectize?

从ajax获取数据后我必须填充selectize 。但它在里面不起作用ajax success

超文本标记语言

<select name="hospital" id="store_hospital">
   <option value="" disabled selected>Choose Hospital</option>
   <?php
     foreach ($hospitals as $hospital) {
   ?>
   <option value="<?php echo $hospital->uid ?>"><?php echo $hospital->name ?></option>
   <?php
   }
   ?>
</select>
<select id="select-to" class="contacts" placeholder="Pick some people..."></select>
Run Code Online (Sandbox Code Playgroud)

JS

$('#store_hospital').on('change', function () {
  var value = $('#store_hospital').val();
  $.ajax({
     type: 'GET',
     url: "/get-store-clients/" + value,
     success: function (data) {
         console.info(data);
     },
     error: function (jqXHR, textStatus, errorThrown) {
            }
        });
    });
$('#select-to').selectize({
        persist: false,
        maxItems: null,
        valueField: 'email',
        labelField: …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery selectize.js

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

月份和年份日期转换

我有一个信用卡到期日,月份和年份只是以字符串的形式出现08/17,如何更改此字符串的格式,以便我可以将其传递给Authorize.net

$creditCard->setExpirationDate( "2017-08");
Run Code Online (Sandbox Code Playgroud)

我试过用,strtotime()但它给了我今年

echo $date = date('Y-m', strtotime($ccInfo['exp_date']));
Run Code Online (Sandbox Code Playgroud)

php datetime authorize.net laravel-5.2

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

Redis CLI 未通过 Laravel 显示最近存储的密钥

我想用我的成绩来缓存redisLaravel做这个

$result =   Cache::remember('orders_cache', 10, function () use ($orders) {
           return $orders;
        });
        return $result;
Run Code Online (Sandbox Code Playgroud)

当我进入我的 Redis-Cli 并执行 时KEYS *,我在orders_cache那里看不到密钥。我已经设置了cache_driverredis.env,我也跑了命令php artisan config:cache。我还使用 composer 安装了 predis 包。

我的开发环境是:

  • PHP7.4
  • Ubuntu 20
  • Laravel 6.0
  • Redis 5.0.7

对此的任何帮助将不胜感激。TIA

php caching in-memory-database redis laravel

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

冰岛语言在javascript警告框中搞砸了

我有一个警报框,我想显示一些冰岛文字,但它没有显示它

<script>
function check() {
alert("Þú verður að vera skráð/ur inn til þess að senda skilaboð");
}
</script>
Run Code Online (Sandbox Code Playgroud)

它显示警告框但文本搞砸了:(

Þúverïuraðveraskráð/ ur inntilþessaðsendasakilaboð

任何帮助请:(

javascript alert character-encoding

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

bootstrap.js类型错误

我在我的网站上遇到错误.错误是:

时间戳:10/17/2012 8:27:23 PM
错误:TypeError:$不是函数
源文件:我的站点的路径/ js/bootstrap.js
行:23

如果这与其他一些jQuery文件冲突,我怎么能删除它?

jquery twitter-bootstrap

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

Node.js浏览器错误

我是Node.js的新手.我按照教程键入了以下内容

var sys = require("util"),
http = require("http");

http.createServer(function(request, response) {
response.sendHeader(200, {"Content-Type": "text/html"});
response.write("Hello World!");
response.close();
}).listen(8080);

sys.puts("Server running at http://localhost:1331/");
Run Code Online (Sandbox Code Playgroud)

但当我进入我的浏览器并输入网址即http:// localhost:1331时 ,无法打开该网址

浏览URL时在cmd中获取以下内容

TypeError: Object #<ServerResponse> has no method 'sendHeader'
at Server.<anonymous> (D:\node_js\hello.js:11:14)
at Server.emit (events.js:70:17)
at HTTPParser.onIncoming (http.js:1511:12)
at HTTPParser.onHeadersComplete (http.js:102:31)
at Socket.ondata (http.js:1407:22)
at TCP.onread (net.js:354:27)
Run Code Online (Sandbox Code Playgroud)

node.js

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

无法移动文件

我正在创建一个目录,然后将上传的文件移入其中,但它给了我这个警告

Warning: move_uploaded_file(): The second argument to copy() function cannot be a directory in G:\xampp\htdocs\product_management\admin\process\process_product.php on line 43

Warning: move_uploaded_file(): Unable to move 'G:\xampp\tmp\phpE5B0.tmp' to '../product_images/10/thumb' in     G:\xampp\htdocs\product_management\admin\process\process_product.php on line 43
Run Code Online (Sandbox Code Playgroud)

我的代码是

if($_FILES['thumb']['name']!=="") {
         echo $path = "../product_images/".$insert_id."/thumb";
         mkdir($path,0777, true);
         move_uploaded_file($_FILES['thumb']['tmp_name'],$path);
     }
     exit;
Run Code Online (Sandbox Code Playgroud)

php mkdir

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

ng2-ckeditor 错误模块未找到&amp;模块的元数据版本不匹配

我正在尝试ng serve我的 angular 4 项目,我看到了这个

ERROR in /var/www/penderie1/src/app/admin/admin.module.ts (20,32): Cannot find module 'ng2-ckeditor'.
ERROR in /var/www/penderie1/src/app/myaccount/myaccount.module.ts (6,32): Cannot find module 'ng2-ckeditor'.
ERROR in /var/www/penderie1/src/app/app.module.ts (6,32): Cannot find module 'ng2-ckeditor'.
ERROR in Error: Error encountered resolving symbol values statically. Could not resolve ng2-ckeditor relative to /var/www/penderie1/src/app/app.module.ts., resolving symbol AppModule in /var/www/penderie1/src/app/app.module.ts, resolving symbol AppModule in /var/www/penderie1/src/app/app.module.ts
    at syntaxError (/var/www/penderie1/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34)
    at simplifyInContext (/var/www/penderie1/node_modules/@angular/compiler/bundles/compiler.umd.js:24979:23)
    at StaticReflector.simplify (/var/www/penderie1/node_modules/@angular/compiler/bundles/compiler.umd.js:24991:13)
    at StaticReflector.annotations (/var/www/penderie1/node_modules/@angular/compiler/bundles/compiler.umd.js:24418:41)
    at _getNgModuleMetadata (/var/www/penderie1/node_modules/@angular/compiler-cli/src/ngtools_impl.js:138:31)
    at _extractLazyRoutesFromStaticModule (/var/www/penderie1/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26)
    at Object.listLazyRoutesOfModule (/var/www/penderie1/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes …
Run Code Online (Sandbox Code Playgroud)

npm-install angular

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

如何获取按下的按钮的值

大家好,我是 Android 开发新手,事实上这是我的第一个应用程序。我想知道

<button
 android:text="1" />
Run Code Online (Sandbox Code Playgroud)

在上面的标签中,text是按钮的值?如果是,那么我如何获取这个值或将其存储在变量中。如果没有,那么如何在android中的任何按钮后面定义一个值?

android

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

Jquery - 单击时不调用函数

我正在更改innerHTMLdiv,然后使用新创建的HTML我调用函数,但由于某种原因,该函数未被调用.以下是我的工作.这是小提琴

$('#click1').click(function () {
    $('#submit').html('this is new html <br /><a href="javascript:;" id= "click2">Click here 2nd</a>')

});

$('#click2').click(function(){
alert("all is well");
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="submit">
    <a href = "javascript:;" id="click1">Click here</a>
</div>
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

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