小编Blo*_*sie的帖子

没有Flash的客户端的SwfUpload后备

我目前在我的asp.net Web应用程序上使用SwfUpload(v2.2.0.1),绝对没有问题.

我想做的是当用户/客户端没有安装闪存时,回退到正常上传.我可以想象这可以通过jquery replace或类似的东西来完成,使用闪存检测脚本.

如果用户/客户端没有javascript,我不需要提供回退.

我将如何编写这种类型的回退或者是否有任何有关swfupload回退的工作示例?

提前致谢.

flash fallback swfupload

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

从字符串路径动态更新JavaScript对象

我试图找出是否可以使用字符串作为路径来更新JavaScript对象.

在下面的例子中,我试图找出如何使用store>book>0>price我的路径更新第一本书的价格 .

我知道我可以通过写作来访问它,data['store']['book'][0]['price']但我需要能够动态地执行此操作.我尝试过一些东西,但没有运气.有任何想法吗?

这需要适用于任何深度,而不是固定的深度


数据:

 var data = { 
      "store": {
        "book": [ 
          { "category": "reference",
            "author": "Nigel Rees",
            "title": "Sayings of the Century",
            "price": 8.95
          },
          { "category": "fiction",
            "author": "Evelyn Waugh",
            "title": "Sword of Honour",
            "price": 12.99
          }
        ],
        "bicycle": {
          "color": "red",
          "price": 19.95
        }
      }
    }
var path = "store>book>0>price"
Run Code Online (Sandbox Code Playgroud)

功能:

function updateObject(object, path, data) {
    var pathArray = path.split(">");
    // Some code here
} 
updateObject(data, path, "10.00");
Run Code Online (Sandbox Code Playgroud)

更新

正如费利克斯指出的那样,答案可以在这里找到. JavaScript对象的动态深度设置 …

javascript path object

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

排序中的SlickGrid选择问题

当我一起使用SlickGrids时selection,sorting我发现选择存储所选行的索引而不是存储所选数据的选择.

如何解决这个问题,以便记住所选数据而不仅仅是索引?


可以在此处找到该问题的演示:http: //jsfiddle.net/blowsie/LKf6j/

要重现该问题,请执行以下步骤;

  1. 选择网格中的第一个项目
  2. 按姓名排序

javascript sorting datagrid selection slickgrid

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

如何在javascript中检查元素类型

我有一种情况,我想使用一些条件将<select>标签转换为<input type="text">和<input type="text">进入<select>bu.那么我怎么知道这个元素是一个类型文本或类型选择使用id属性.

html javascript jquery dom

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

如何在Windows上使用git-new-workdir?

我有一个有两个分支的回购,我想同时处理.经过一番阅读后,我发现git有一个脚本git-new-workdir.


我尝试运行使用git for windows bash中的脚本,但得到以下错误.

$ git-new-workdir
sh: git-new-workdir: command not found
Run Code Online (Sandbox Code Playgroud)

如何在Windows上使用此脚本?

windows git bash branch msysgit

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

从MSBuild发布中排除`.js`文件而不是'.min.js'文件

使用Visual Studio和MSBuild我希望能够排除所有.js文件并包含.min.js我的部署中的所有文件.

我知道这可以使用visual studio中的文件属性来实现,但这不是一个选项,因为文件太多了.


我的PublishProfileVisual Studio项目中有以下内容.一切都很好,除了<ItemGroup>

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <WebPublishMethod>FileSystem</WebPublishMethod>
        <LastUsedBuildConfiguration>Delpoy-Static</LastUsedBuildConfiguration>
        <LastUsedPlatform>Any CPU</LastUsedPlatform>
        <SiteUrlToLaunchAfterPublish />
        <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
        <ExcludeApp_Data>True</ExcludeApp_Data>
        <publishUrl>\\***\wwwroot\***.com\static</publishUrl>
        <DeleteExistingFiles>False</DeleteExistingFiles>
    </PropertyGroup>
    <!--This does not work, but gives the idea of what I want …
Run Code Online (Sandbox Code Playgroud)

deployment msbuild build msdeploy visual-studio

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

JQery UI自动完成在JQ UI V1.8.6中附加到body而不是给定对象

我已经在我的网页上使用jquery自动完成了一段时间,但是在从1.8rc3更新jquery ui到版本1.8.6后,自动完成ul对象现在被附加到正文而不是直接在给定的选择器之后.

下面的代码当然无效,它只是突出了我的问题.

在1.8rc3

   $("#myinput").autocomplete(.....

   <input id="myinput"/> 
   <ul id="autocomplete"></ul>
   <div>Loads of other content</div>
   <div>Loads of other content</div>
   <div>Loads of other content</div>
   </body>
Run Code Online (Sandbox Code Playgroud)

在1.8.6

   $("#myinput").autocomplete(.....

   <input id="myinput"/> 
   <div>Loads of other content</div>
   <div>Loads of other content</div>
   <div>Loads of other content</div>
   <ul id="autocomplete"></ul>   
   </body>
Run Code Online (Sandbox Code Playgroud)

所以我的问题是,有没有办法让自动完成在我给定的选择器之后附加而不是附加到正文?

jquery jquery-ui

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

Silverlight按钮 - 在悬停时更改前景颜色

我已经为我的Silverlight按钮创建了一个样式模板,设法创建圆角和悬停状态,这会改变大多数样式而没有任何问题,但是......

我无法弄清楚如何Foreground改变颜色hover.

请参阅下面的代码,我遇到问题的部分目前已被注释掉.

    <Style TargetType="Button" >
        <Setter x:Name="myFontColor" Property="Foreground" Value="#000000"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid Height="28">
                        <Border x:Name="myBorder" BorderBrush="#C4C4C4" BorderThickness="1" CornerRadius="5">
                            <Rectangle x:Name="BackgroundGradient" RadiusX="5" RadiusY="5">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop x:Name="GradientStop1" Color="#FDFDFD" Offset="0" />
                                        <GradientStop x:Name="GradientStop2" Color="#D6D6D6" Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Border>
                        <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" />
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommomStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation 
                                                    Storyboard.TargetName="GradientStop1"
                                                    Storyboard.TargetProperty="Color"
                                                    From="#FDFDFD" To="#0A284B" …
Run Code Online (Sandbox Code Playgroud)

silverlight button hover silverlight-5.0

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

如何删除或隐藏李

<li>ff<strong>foobar</strong><a class="icon-close" href="#."></a></li>
<li>ff<strong>foobar</strong><a class="icon-close" href="#."></a></li>
<li>ff<strong>foobar</strong><a class="icon-close" href="#."></a></li>
<li>ff<strong>foobar</strong><a class="icon-close" href="#."></a></li>
<li>ff<strong>foobar</strong><a class="icon-close" href="#."></a></li>
<li>ff<strong>foobar</strong><a class="icon-close" href="#."></a></li>
<li>ff<strong>foobar</strong><a class="icon-close" href="#."></a></li>
Run Code Online (Sandbox Code Playgroud)

单击时a,li应删除相应的对应项.

$(.close-icon).hide(); 隐藏每一件事.

javascript jquery

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

PHP - 通过数组排序并重复[modulo-operator]

我需要能够循环一个项目数组并从另一个数组中给它们一个值,我无法理解它.

我的阵列

$myarray = array('a','b','c'); 
Run Code Online (Sandbox Code Playgroud)

假设我有一个foreach循环,我总共循环了6个项目.

如何获得以下输出

item1 = a
item2 = b
item3 = c
item4 = a
item5 = b
item6 = c
Run Code Online (Sandbox Code Playgroud)

我的代码看起来像这样.

$myarray = array('a','b','c'); 
$items = array(0,1,2,3,4,5,6);
foreach ($items as $item) {
   echo $myarray[$item];
}
Run Code Online (Sandbox Code Playgroud)

在线示例. http://codepad.viper-7.com/V6P238

我当然希望能够循环无数次

php arrays loops sequence

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