小编Joh*_*sch的帖子

在PHP中发布变量

如何在不使用表单的情况下在PHP中发布变量,并从下一页访问变量.

我真正想做的是发布一个这样的变量:

$username = "Sam";
$_POST[$username];
Run Code Online (Sandbox Code Playgroud)

然后我试图从我元刷新的页面访问它.

有任何想法吗?

php variables post

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

如何使用jQuery为文本颜色设置动画?

$(document).ready(function(){
    $('a.nav_menu')
        .css( {backgroundPosition: "0 0"} )
        .mouseover(function(){
            $(this).animate({
            backgroundPosition:"(-650px 0)",
            'color': '#000000'
        }, {duration:700})
        })
        .mouseout(function(){
            $(this).animate({backgroundPosition:"(0px 0)"}, {duration:900, complete:function(){
                $(this).css({backgroundPosition: "0 0"})
            }})
        })
});
Run Code Online (Sandbox Code Playgroud)

这有什么问题?文字颜色不会改变.

jquery jquery-animate

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

对象引用未设置为对象的实例

我的机器今天在玩吗?

当我运行TestConnectionString()此对象的方法时,我在连接字符串设置中得到错误.

public class CustomerDAL
{
   string connectionString = ConfigurationManager.ConnectionStrings["myConnection"].Name;

    public CustomerDAL()
    {

    }

    public string TestConnection()
    {
        System.Data.SqlClient.SqlConnection conn =  new System.Data.SqlClient.SqlConnection(connectionString);
        conn.Open();

        if (conn.State == System.Data.ConnectionState.Open)
        {
            return "Open";
        }
        else
        {
            return "Close";
        }
     }
}
Run Code Online (Sandbox Code Playgroud)

c#

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

Sql Query无法正常工作!

INSERT INTO `test` (`x`, `y`)  WHERE `id` = `$id`

VALUES (`$x`, `$y`)
Run Code Online (Sandbox Code Playgroud)

这个查询有什么问题吗?我mysql_query()在php文件中的一个函数中运行它.

php mysql sql

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

如何在VB.NET中获取ASCII字符串的长度(即字符数)?

我正在使用此代码从tcpclient返回一些字符串,但是当字符串返回时,它有一个前导"字符.我正在尝试删除它,但Len()函数是读取字节数而不是字符串本身.我怎么能改变这个来给我字符串的长度,就像我通常使用它而不是字符串本身的数组?

 Dim bytes(tcpClient.ReceiveBufferSize) As Byte
 networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))

 ' Output the data received from the host to the console.'
 Dim returndata As String = Encoding.ASCII.GetString(bytes)

 Dim LL As Int32 = Len(returndata)
Run Code Online (Sandbox Code Playgroud)

Len() 报告字节数而不是字符串中的字符数.

vb.net string ascii tcpclient

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

c ++中的/ clr选项

有人可以帮我找到以下错误的解决方案:

"致命错误C1190:托管目标代码需要'/ clr'选项"

我的配置是......

  • Visual Studio 2008
  • Windows 7的

这是代码(我通过使用网络资源获得)

#using <mscorlib.dll>
using namespace System;
using namespace System::IO;

int main() {
    // Create a reference to the current directory.
    DirectoryInfo* di = new DirectoryInfo(Environment::CurrentDirectory);
    // Create an array representing the files in the current directory.
    FileInfo* fi[] = di->GetFiles();
    Console::WriteLine(S"The following files exist in the current directory:");
    // Print out the names of the files in the current directory.
    Collections::IEnumerator* myEnum = fi->GetEnumerator();
    while (myEnum->MoveNext()) {
        FileInfo* fiTemp = __try_cast<FileInfo*>(myEnum->Current); …
Run Code Online (Sandbox Code Playgroud)

clr using-statement directoryinfo visual-studio-2008 windows-7

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

JQUERY无法在本地计算机上运行

我在我的机器上尝试JQUERY,但出于某种原因,似乎没有任何效果.这是测试文件:

<html>
<head>
<script type="text/css" src="jquery.js">
</script>
<script type="text/javascript">
    $("p").mouseover(function () {
      $(this).css("color","black");
    });

    $(document).ready(function(){
$("body").css("background-color","black");
$("body").css("color","white");
});
</script>
</head>
<body>
<h1>This is a test</h1>
<p>Roll over me!</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

什么都没有效果.此外,如果有人想知道,通过我的域和本地访问都不起作用.我真的很困惑,因为我从互联网上复制了大部分代码,以防万一我的打字有问题.

出于某种原因,firefox抛出此错误:

代码:评估
$未定义
http://hussain.mooo.com/jq.html
行:6
$未定义
http://hussain.mooo.com/jq.html
行:6

新代码(移动了onmouseover handeler)

    <script src="jquery.js" type="text/css">
</script>
<script type="text/javascript">
$(document).ready(function(){
    $("p").mouseover(function () {
      $(this).css("color","black");
    });
$("body").css("background-color","black");
$("body").css("color","white");
});
</script>
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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