问题列表 - 第34530页

用Javascript清除<textarea>?

我想有类似的东西 <textarea>Welcome, click here to type.</textarea>

然后在用户点击文本区域时清除.

但.

在任何人提到此网站上存在此问题的重复之前,还有其他详细信息未在答案中提及.例如:

我已经看到有可能清除<textarea>没有onclick(),只有一个<textarea id="someid">.我只是不知道他们是怎么做到的,我想这样做.我不仅喜欢我的代码清洁,而且我想知道这是如何可能的.(我想在onClick()某种程度上在里面<head><script type="text/javascript"></script></head>?)

我也想<textarea>明确的人一旦再次上键入文本区域的东西和点击.当用户再次单击文本区域以编辑输入的文本的某一部分时.

我不太了解Javascript,但这是我看到它工作的方式:

  1. 如果<textarea>匹配该值Welcome, click here to type; 一旦用户在文本区域中单击,它应该清除文本.
  2. 如果<textarea>为空且不再处于焦点,则应Welcome, click here to type.再次返回值" ".

这意味着再次单击文本区域将不会清除文本,这会阻止在用户已在框中键入内容后清除文本.

在此先感谢帮助我!您对此事的知识将不胜感激.:)

javascript

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

获取/拉取超大型存储库的一部分?

这可能是显而易见的,之前已经多次以不同的方式询问过,但是在搜索了一段时间之后我找不到答案.

假设如下:

  • 比方说,我本地有一块500GB的磁盘;
  • 我有一个100 TB的远程存储库; 因此,克隆整个存储库的成本根本不可行;
  • 用于创建远程存储库的工作目录由1000个顶级目录DIR001,DIR002,... DIR00N组成,每个目录包含多个子目录,文件仅在叶子目录下(例如DIR001/subdir1/fileA1 ... DIR001/subf1/fileAN和DIR001/subdir2/fileB1 ... DIR001/subdir2/fileBN,...
  • 我没有明确标记或分支目录DIR001,DIR002,... DIR00N或其他任何事情
  • 我初始化一个全新的本地git存储库

如何有效地从远程存储库中提取或获取DIR001/subdir2/fileB1 ... DIR001/subdir2/fileBN的最后提交版本,而不是其他任何内容?

来自远程存储库的DIR001/subdir2/fileB1 ... DIR001/subdir2/fileBN 中的单个文件的最后提交版本,没有其他内容?

如何有效地提取或获取以前提交的所述文件子集的版本而不是其他内容?

也许fetch/pull不是正确的命令.

git

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

这是禁止用户创建密码的好习惯吗?

我正在使用Intranet站点,需要选择两种方式:1.当用户可以将密码更改为他喜欢的任何单词时禁用选​​项,例如pass123.这样就会有一个按钮,使用一些复杂的算法生成一个新密码,然后用户接受它的使用.2.制作标准密码更改功能.这样用户可以输入他喜欢的任何密码并保存.谢谢.

security passwords intranet

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

Flex 4检测用户是否按下回车键

如果用户在密码字段中按Enter键,则secnario很简单,我想提交登录进行处理.

如何在特定文本框中检测到该事件.

提前致谢

apache-flex keypress

7
推荐指数
2
解决办法
9612
查看次数

Page_PreInit没有调用?

我正在运行ASP.NET 4.0项目.

.aspx页面已AutoEventWireup="true"在标题中设置.

虽然OnPreInit叫,Page_PreInit不是吗?任何人都可以提出什么问题?

protected void Page_PreInit(object sender, EventArgs e)
{
    Response.Write("bar");
}

protected override void OnPreInit(EventArgs e)
{
    Response.Write("foo");
    base.OnPreInit(e);
}
Run Code Online (Sandbox Code Playgroud)

c# page-lifecycle

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

为对象属性分配值

有更快的方法来做以下事情吗?想要减少代码行数.

var item = new SpecialObject();
var dictionary = new Dictionary<string, object>();
dictionary.Add("key1", "value1");
dictionary.Add("key2", "value2");

item.Name = "name";
item.Id = 1;
item.Dictionary = dictionary;
Run Code Online (Sandbox Code Playgroud)

谢谢..

c#

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

RelativeLayout高度填充剩余空间

我的xml文件中有以下布局:

<RelativeLayout android:layout_width="fill_parent"
                android:layout_height="fill_parent">

    <FrameLayout android:id="@+id/logoLayout"  
                 android:layout_width="fill_parent"
             android:layout_height="wrap_content">
          -- some images
    </FrameLayout>


    <RelativeLayout android:layout_width="fill_parent" 
                    android:layout_height="wrap_content" 
                    android:gravity="center" 
                    android:orientation="vertical"
                    android:layout_below="@+id/logoLayout">

               Button 1
               Button 2
               Button 3
               Button 4

    </RelativeLayout>

    <RelativeLayout android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dip"
            android:layout_alignParentBottom="true">

                 Button 5
    </RelativeLayout>

<RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

也许我没有以最好的方式做到这一点.我想要的是:让包含4个按钮的布局使用顶部和底部布局之间的整个空间,并且我希望按钮在布局中平行排列.

像这样:http://img16.imageshack.us/i/androidq.png/

我添加了整个布局代码:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background">


    <!--The header of the page-->
        <FrameLayout android:id="@+id/logoLayout" 
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content">        

             <ImageView android:id="@+id/logoBackground" 
                        android:src="@drawable/logo_background_small"
                        android:layout_width="fill_parent" 
                        android:layout_height="wrap_content"/>

             <ImageView android:id="@+id/logoImage" 
                        android:src="@drawable/logo_small"
                        android:layout_width="wrap_content" 
                        android:layout_height="wrap_content" 
                        android:layout_gravity="left"
                        android:gravity="center"
                        android:padding="3dip"/>  

             <TextView android:layout_width="fill_parent" 
                       android:layout_height="wrap_content" 
                       android:text="@string/tracks"
                       android:layout_gravity="center"
                       android:gravity="right"
                       android:textSize="22dip" …
Run Code Online (Sandbox Code Playgroud)

android android-relativelayout

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

在侧边栏外使用小部件?

是否可以在侧边栏之外使用小部件?当您在管理面板中分配它们时,您必须将它们拖到侧边栏,但我想在侧边栏外部实现搜索功能.我可以这样做吗?

wordpress

7
推荐指数
2
解决办法
5120
查看次数

如何制作Perl"哈希数组阵列"?

我认为我需要的是一个哈希数组数组,但我不知道如何做到这一点.

Perl可以做到吗?

如果是这样,代码将如何?

arrays perl hash

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

用于将图像调整为最大高度和最大宽度范围的数学

鉴于图像:

maxWidth = 400;
maxHeight = 200;
width = photo.Width;
height = photo.Height;
Run Code Online (Sandbox Code Playgroud)

如果任一维度超过最大属性,我将如何缩放图像?

以下是一些测试用例:

300x300  :   Too tall, but width ok.
500x200  :   Too wide, but height ok.
650x300  :   Too tall and too wide
300x190  :   Fine, don't resize
Run Code Online (Sandbox Code Playgroud)

我无法想象数学,对不起,如果它太简单了!给我带来最多麻烦的案例是两个尺寸都超过允许的最大值.

scaling resize image-processing

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