小编use*_*331的帖子

如何使用JavaScript获取文本输入字段的值?

我正在使用JavaScript进行搜索.我会使用一个表单,但它在我的页面上弄乱了其他东西.我有这个输入文本字段:

<input name="searchTxt" type="text" maxlength="512" id="searchTxt" class="searchField"/>
Run Code Online (Sandbox Code Playgroud)

这是我的JavaScript代码:

<script type="text/javascript">
  function searchURL(){
    window.location = "http://www.myurl.com/search/" + (input text value);
  }
</script>
Run Code Online (Sandbox Code Playgroud)

如何从文本字段中获取值到JavaScript?

javascript dom input

804
推荐指数
11
解决办法
205万
查看次数

td宽度,不工作?

所以我在这里有这个代码:

<table>
    <tr>
        <td width="200px" valign="top">
            <div class="left_menu">
                <div class="menu_item">
                    <a href="#">Home</a>
                </div>
            </div>
        </td>
        <td width="1000px" valign="top">Content</td>
    </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

用CSS

.left_menu {
    background: none repeat scroll 0 0 #333333;
    border-radius: 5px 5px 5px 5px;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
}

.menu_item {
    background: none repeat scroll 0 0 #CCCCCC;
    border-bottom: 1px solid #999999;
    border-radius: 5px 5px 5px 5px;
    border-top: 1px solid #FFFFCC;
    cursor: pointer;
    padding: 5px;
}
Run Code Online (Sandbox Code Playgroud)

它适用于我的浏览器很好,我已经在每个浏览器Mac和PC的测试,但有人抱怨说,tdwidth200不断变化的宽度.我不知道他在说什么.有谁知道为什么他或她看到宽度变化td

html css html-table width

76
推荐指数
7
解决办法
26万
查看次数

在PHP中添加三个月的日期

我有一个名为$effectiveDate包含日期2012-03-26的变量.

我试图在这个日期增加三个月并且没有成功.

这是我尝试过的:

$effectiveDate = strtotime("+3 months", strtotime($effectiveDate));
Run Code Online (Sandbox Code Playgroud)

$effectiveDate = strtotime(date("Y-m-d", strtotime($effectiveDate)) . "+3 months");
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?两段代码都没有用.

php date strtotime

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

Pentaho数据集成SQL连接

我使用Pentaho的数据集成,我试图通过MySQL的连接到我的数据库,但是当我做我得到这个错误.....

Error connecting to database [devdb2] : org.pentaho.di.core.exception.KettleDatabaseException: 
Error occured while trying to connect to the database

Exception while loading class
org.gjt.mm.mysql.Driver


org.pentaho.di.core.exception.KettleDatabaseException: 
Error occured while trying to connect to the database

Exception while loading class
org.gjt.mm.mysql.Driver


    at org.pentaho.di.core.database.Database.normalConnect(Database.java:368)
    at org.pentaho.di.core.database.Database.connect(Database.java:317)
    at org.pentaho.di.core.database.Database.connect(Database.java:279)
    at org.pentaho.di.core.database.Database.connect(Database.java:269)
    at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:86)
    at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2464)
    at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:533)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123)
    at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:26)
    at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:119)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at …
Run Code Online (Sandbox Code Playgroud)

mysql pentaho

66
推荐指数
5
解决办法
14万
查看次数

如何将.bak文件导入Microsoft SQL Server 2012?

谷歌搜索了一段时间没有答案....任何人都可以帮忙吗?

sql sql-server sql-server-2012

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

CSS隐藏滚动条,但元素可滚动

我有这个名为items的元素,元素内的元素长度超过元素高度,我想让它可滚动但隐藏滚动条,我该怎么做?

<div class="left-side">
    <div class="items" style="display:block;width: 94%;margin: 0 auto;overflow: hidden;">
    </div>
</div>

.left-side {
    width: 1470px;
    padding-top: 20px;
    height: 878px;
}
Run Code Online (Sandbox Code Playgroud)

我尝试将左侧类溢出设置为auto,但是没有做任何事情.

html css

25
推荐指数
5
解决办法
10万
查看次数

如何在不使用背景图像的情况下创建视差效果?

我想不使用创建的视差效果background-imagebackground-attachment: fixed,因为background-attachment: fixed没有在iOS上工作这么好.这是我想出的:

HTML

<article class="twentyseventeen-panel">
  <div class="panel-image">
    <div style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;" >
      <img src="<?php echo esc_url( $thumbnail[0] ); ?>" style="width: 100%;" />
    </div>
  </div>
</article>
Run Code Online (Sandbox Code Playgroud)

CSS

.twentyseventeen-panel {
    overflow: hidden;
    position: relative;
}
.panel-image {
    position: relative;
    height: 100vh;
    max-height: 200px;
}
Run Code Online (Sandbox Code Playgroud)

现在我不得不去图像滚动来做视差效果.我尝试将图像设置到某个fixed位置,但是当我这样做时,我的图像不再显示.如何让此图像具有视差效果?

html css parallax

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

Angular 2滚动到顶部路线改变不起作用

当路线改变时,我试图在我的角度2站点上滚动到我的页面顶部,我尝试了以下,但没有任何反应,当我将路线从一个页面更改为另一个页面时,页面滚动到它所在的位置在第一页:

import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';

@Component({
    selector: 'my-app',
    template: '<ng-content></ng-content>',
})
export class MyAppComponent implements OnInit {
    constructor(private router: Router) { }

    ngOnInit() {
        this.router.events.subscribe((evt) => {
            if (!(evt instanceof NavigationEnd)) {
                return;
            }
            window.scrollTo(0, 0)
        });
    }
}
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

javascript jquery angular

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

使用NSURLCredential进行AFNetworking

我有3个方法,UserLogin,Login和LogoutButtonPressed:

UserLogin:我使用AFNetworking使用NSURLCredential连接到Windows身份验证的URL:

-(void)UserLogin:(NSString *)user andPassWordExists:(NSString *)password completionHandler:(void (^)(NSArray *resultsObject, NSError *error))completionHandler
{

   NSURL *url = [NSURL URLWithString:kIP];
   NSURLRequest *request = [NSURLRequest requestWithURL:url];

    AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]
                                         initWithRequest:request];

    NSURLCredential *credential = [NSURLCredential
                                   credentialWithUser:user
                                   password:password
                                   persistence:NSURLCredentialPersistenceForSession];

    [operation setCredential:credential];


    [[NSOperationQueue mainQueue] addOperation:operation];

    [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {

        if (completionHandler) {
            completionHandler(responseObject, nil);
        }

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

        if (completionHandler) {
            completionHandler(nil, error);
        }

    }];

    [operation start];

}
Run Code Online (Sandbox Code Playgroud)

Login方法调用此方法:

- (void)Login
{
    NSString *rawString = [self.idTextField text];
    NSCharacterSet *whitespace = …
Run Code Online (Sandbox Code Playgroud)

objective-c nsurlcredential ios afnetworking

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

LinkBut​​ton中的C#Target ="_ blank"

是有可能有一个target="_blank"LinkButton...矿似乎并不奏效

<asp:LinkButton runat="server" ID="g31" Text="PDF" 
    CommandArgument='<%# DataBinder.Eval(Container.DataItem,"productID") %>'
    CommandName='<%# DataBinder.Eval(Container.DataItem,"documentID") %>'
    OnCommand="linkbutton_showpdf" target="_blank">
</asp:LinkButton>
Run Code Online (Sandbox Code Playgroud)

或者我必须使用不同的按钮格式?

c# linkbutton target

16
推荐指数
4
解决办法
6万
查看次数