小编com*_*alt的帖子

SweetAlert - 改变按钮的颜色

我正在尝试更改取消按钮的颜色,就像我可以为确认按钮,但它似乎没有工作由于某种原因.

(参见https://jsfiddle.net/x20ra1o1/))

代码是:

swal({
    title: "Are you sure?",
    text: "You will not be able to recover this imaginary file!",
    type: "warning",
    showCancelButton: true,
    cancelButtonColor: "#DD6B55",
    confirmButtonColor: "#DD6B55",
    confirmButtonText: "Yes, delete it!",
    cancelButtonText: "No, cancel please!",
    closeOnConfirm: false,
    closeOnCancel: false
}, function (isConfirm) {
    if (isConfirm) {
        swal("Deleted!", "Your imaginary file has been deleted.", "success");
    } else {
        swal("Cancelled", "Your imaginary file is safe :)", "error");
    }
});
Run Code Online (Sandbox Code Playgroud)

javascript sweetalert

13
推荐指数
8
解决办法
4万
查看次数

谷歌地图 - 查找给定半径内的所有标记Javascript/Php

我有这个脚本,将在谷歌地图上显示自定义标记,但我想包括一个输入文本框,并能够输入一个城市/州和一个邮政编码,看看是否有任何标记,让我们说400距离该城市/州或邮政编码的里程数.我很乐意,如果地图可以是动态的,那么当你输入城市/州或邮政编码时,它会通过删除所有其他标记并仅留下该半径范围内的标记来显示地图上的结果,如果那太难了,那么一个简单的改变框说单位是最接近的也将是OK :)我搜索并找到一些说我应该加载几何库并computeDistanceBetween()用来找到每个标记距离你的中心点的距离但是我不知道如何做邮政编码部分或如何将所有这些放在一起工作.

这是我的代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title></title>
<script type="text/javascript"  src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/src/markerclusterer.js"></script>

<script type="text/javascript"> 
   var image = new google.maps.MarkerImage("marker-images/image.png",new google.maps.Size(40,35),new google.maps.Point(0,0),new google.maps.Point(20,35));

   var shadow = new google.maps.MarkerImage(
                            'marker-images/shadow.png',
                            new google.maps.Size(62,35),
                            new google.maps.Point(0,0),
                            new google.maps.Point(20,35)
                          );

   var shape = {
                coord: [27,0,30,1,32,2,34,3,35,4,36,5,38,6,39,7,39,8,39,9,39,10,38,11,37,12,33,13,34,14,34,15,33,16,32,17,31,18,27,19,28,20,28,21,27,22,26,23,22,25,23,26,24,27,24,28,24,29,24,30,24,31,24,32,23,33,22,34,17,34,16,33,15,32,15,31,14,30,14,29,15,28,15,27,16,26,17,25,13,23,12,22,11,21,11,20,12,19,8,18,7,17,6,16,5,15,5,14,6,13,2,12,1,11,0,10,0,9,0,8,0,7,1,6,3,5,4,4,5,3,7,2,9,1,12,0,27,0],
                type: 'poly'
          };

     // this variable will collect the html which will eventually be placed in the side_bar 
     var side_bar_html = ""; 

     // arrays to hold copies of the markers and html used …
Run Code Online (Sandbox Code Playgroud)

javascript php ajax google-maps

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

创建文本框并在页面加载时插入数据

我想知道如何创建文本框并在页面加载时插入数据.

我要做的是从数据库打开一个数组字符串,创建文本框并在页面加载时填充文本框.

我有一个来自ms sql数据库的数组字符串,看起来像这样

test,test;bla;bla2;test44;test55;test66
Run Code Online (Sandbox Code Playgroud)

我将每个单独的数组分开;,我想创建文本框并将值一个一个地插入到文本框中,因此最终结果如下所示:

在此输入图像描述

我不知道如何使用下面的代码.

无论我尝试什么,我搞乱了添加/删除功能,或者当点击加号按钮时我最终克隆所有文本框.

谢谢

查看以下代码或转至https://jsfiddle.net/kj3cwww0

<script type='text/javascript'>//<![CDATA[
 $(function() {
    var clone = function(tmpl) {
            return $((tmpl.clone()).html())
        },
        $template = $('#template_add_form'),
        formArray = [ clone($template) ], // init array with first row
        $formEntries = $('#entries');

    $(document).on('click', '.btn-add', function() {
        formArray.push(clone($template));
        updateForm();

        // set focus to adding row = last element in array
        $(formArray).last()[0]
            .find('input')
            .first()
            .focus();
    });

    // remove not working yet

    $(document).on('click', '.btn-remove', function(evt) {
        var id;

        // iterate over formArray to …
Run Code Online (Sandbox Code Playgroud)

javascript jquery asp-classic

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

在mysql中只选择唯一的行/记录

我想看看如何才能获得具有独特城市的唯一行/记录,而不关心它是否是资本,例如:

Akron
akron
aKRON
Run Code Online (Sandbox Code Playgroud)

只返回一条记录.

我累了这样的东西,但它不起作用

"SELECT DISTINCT(city) AS city,state_prefix,lattitude,longitude  FROM zip_code WHERE city LIKE '$queryString%' LIMIT 10"
Run Code Online (Sandbox Code Playgroud)

谢谢...

mysql sql

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

AngularJS-进度栏为100%后5秒重新加载页面

进度栏为100%后,我想在5秒后重新加载页面

我拥有的代码是:

<!DOCTYPE HTML>
<!--
/*
 * jQuery File Upload Plugin AngularJS Demo
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2013, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * https://opensource.org/licenses/MIT
 */
-->

<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Demo - AngularJS version</title>
<meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery angularjs jquery-file-upload

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

重新加载iframe而不闪烁/闪存(在Javascript中)

我想问一下是否有人有一个简单的解决方案,允许我重新加载/刷新iframe,但在页面重新加载时没有闪烁/闪烁,这可能吗?也许为动画模糊,然后模糊而不是闪烁/闪光?我不知道任何输入会有所帮助,

谢谢.

这是我现在重新加载iframe的方法

document.getElementById("FrameID").contentDocument.location.reload(true);
Run Code Online (Sandbox Code Playgroud)

谢谢您的帮助.

javascript ajax jquery

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

jQuery-File-Upload-仅显示以特定文件名开头的文件

如何设置它以仅显示以特定文件名开头的文件,而不显示文件夹中的所有文件?

示例:文件夹中的文件:

1111_file1.jpg
1111_file2.jpg
2222_anotherfile.jpg
2222_anotherfile2.jpg
3333_anotherfile4.jpg
Run Code Online (Sandbox Code Playgroud)

我只想显示以 1111_

我正在使用此处找到的AngularJS版本LINK

我唯一更改的是添加了一个隐藏的输入,该输入将设置值,例如: <input type="hidden" name="wo" value="1111_">

这是下面的代码:

<!DOCTYPE HTML>
<!--
/*
 * jQuery File Upload Plugin AngularJS Demo
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2013, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * https://opensource.org/licenses/MIT
 */
-->

<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Demo - AngularJS version</title>
<meta name="description" …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery post file-upload

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

SQL Server:过去30周每周平均得分

我想弄清楚如何获得CHECK_AMOUNTSQL Server 2008中过去/过去30周的每周平均值.

我试过这样的事情(见下文),但我认为这是几个月而不是几个星期.

SELECT TOP 30
    AVG(CHECK_AMOUNT) AS W2 
FROM 
    CHECKS 
WHERE 
    NOT UNT='256' 
GROUP BY 
    YEAR(DATE_GIVEN), MONTH(DATE_GIVEN) 
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我如何才能做到这一点,

谢谢...

sql sql-server-2008

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

谷歌地图具有完全相同位置的多个标记不起作用

我想检查是否有任何现有标记与新标记的latlng匹配,如果是,则合并信息窗口/工具提示文本.

这就是我试图做的事情:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title></title>
<script type="text/javascript"  src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/src/markerclusterer.js"></script>


<script type="text/javascript"> 
var map;
var mc;//marker clusterer
var mcOptions = {gridSize: 10, maxZoom: 8};
var infowindow = new google.maps.InfoWindow();//global infowindow
var geocoder = new google.maps.Geocoder(); //geocoder
var address = new Array("42.3334,-89.1572",
"39.2058,-76.7531",
"39.7751,-86.1322",
"40.4894,-78.3499",
"42.0203,-87.9059",
"36.2673,-86.2912",
"33.6115,-84.3745",
"44.9793,-93.273",
"40.1461,-76.0738",
"32.2911,-90.1927",
"32.9315,-96.6158",
"36.0553,-79.8317",
"41.8397,-88.0887",
"47.8029,-103.267",
"34.106,-83.589",
"41.5907,-87.3199",
"43.0905,-74.3554",
"40.3438,-74.4289",
"40.8651,-96.8231",
"40.8651,-96.8231",
"41.759,-88.1524",
"38.2512,-86.8675",
"41.8119,-87.6873",
"41.3651,-89.0866",
"25.7791,-80.1978",
"41.6404,-88.0696",
"41.7684,-88.1366",
"39.7299,-86.4234",
"41.5234,-81.5996",
"41.6233,-88.0225",
"41.0171,-80.8029",
"40.2899,-82.9811",
"41.8119,-87.6873",
"32.3445,-99.8021",
"41.8119,-87.6873", …
Run Code Online (Sandbox Code Playgroud)

google-maps google-maps-api-3 google-maps-markers

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

SimpleXML错误处理

我正在加载一个simpleXML url,如下所示:

$City_and_State = "Miami,FL"

    $url="https://www.google.com/ig/api?weather=$City_and_State&hl=en&referrer=googlecalendar";
    $xml = simplexml_load_file($url);
Run Code Online (Sandbox Code Playgroud)

我得到的数据是:

<?xml version="1.0"?>
<xml_api_reply version="1">
  <weather section="0" row="0" mobile_zipped="1" mobile_row="0" tab_id="0" module_id="0">
    <forecast_information>
      <city data="Miami, FL"/>
      <postal_code data="Miami,FL"/>
      <latitude_e6 data=""/><longitude_e6 data=""/>
      <forecast_date data="2013-08-26"/>
      <current_date_time data="1970-01-01 00:00:00 +0000"/>
      <unit_system data="US"/>
    </forecast_information>
    <current_conditions>
      <condition data="Mostly Cloudy"/>
      <temp_f data="86"/><temp_c data="30"/>
      <humidity data="Humidity: 76%"/>
      <icon data="/ig/images/weather/mostly_cloudy.gif"/>
      <wind_condition data="Wind: NE at 0 mph"/>
    </current_conditions>
    <forecast_conditions>
      <day_of_week data="Mon"/>
      <low data="77"/>
      <high data="93"/>
      <icon data="/ig/images/weather/thunderstorm.gif"/>
      <condition data="Thunderstorm"/>
    </forecast_conditions>
    <forecast_conditions>
      <day_of_week data="Tue"/>
      <low data="77"/>
      <high data="93"/>
      <icon data="/ig/images/weather/chance_of_storm.gif"/>
      <condition …
Run Code Online (Sandbox Code Playgroud)

php

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