我有参数:
http://example.com?ex=http://la.net?c1=a1&c2=a2&c3=a3
Run Code Online (Sandbox Code Playgroud)
我想重定向到此 URL,但当我这样做时,我会进入
http://example.com?ex=http://la.net?c1=a1
Run Code Online (Sandbox Code Playgroud)
我知道是因为这个&标志...
谁能告诉我为什么这个表单没有正确地向服务器提交值?
<form method="post" action="http://www.***.com/index.php/session/authenticate" class="form login" id="login_form">
<div class="group wat-cf">
<div class="left">
<label class="label right">Login</label>
</div>
<div class="right">
<input type="text" class="text_field" id="username"/>
</div>
</div>
<div class="group wat-cf">
<div class="left">
<label class="label right">Password</label>
</div>
<div class="right">
<input type="password" class="text_field" id="password"/>
</div>
</div>
<div class="group navform wat-cf">
<div class="right">
<button class="button" type="submit">
<img src="images/icons/key.png" alt="Save" /> Login
</button>
</div>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
在服务器端,我回显了$_POST空的超全局,我可以看到在提交表单时发送的请求标头:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:0
Content-Type:application/x-www-form-urlencoded
Cookie:ci_session=***session_id=***user_agent%22%3Bs%3A50%3A%22Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_6_7%29+App%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1307578661%3B%7D31ee24db2875550081268dc7df883f76; ci_csrf_token=***
Host:www.***.com
Origin:http://**.com
Referer:http://***.com/index.php/session/login
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS …Run Code Online (Sandbox Code Playgroud) 我有这个HTML块:
<h2>heading A</h2>
<p>paragraph 1 of A</p>
<p>paragraph 2 of A</p>
<h2>heading B</h2>
<ul id="list-B">
<li>list B1</li>
<li>list B2</li>
</ul>
<p>paragraph 1 B</p>
<h2>...</h2>
..
Run Code Online (Sandbox Code Playgroud)
我需要抓住每个" h2及其内容"并将它们分组为以下内容:
<div class="news">
<h2>heading A</h2>
<div class="content">
<p>paragraph 1 of A</p>
<p>paragraph 2 of A</p>
</div>
</div>
<div class="news">
<h2>heading B</h2>
<div class="content">
<ul id="list-B">
<li>list B1</li>
<li>list B2</li>
</ul>
<p>paragraph 1 B</p>
</div>
</div>
...
Run Code Online (Sandbox Code Playgroud)
有什么建议?
抱歉这个基本问题,但为什么0x11是17十进制(print(%d, 0x11)=17?
我搜索有关从十六进制转换为十六进制的方式的信息,但它没有谈论这种数字.
我需要画2个div之间的一条线.我目前使用jQuery.
以下是我的HTML代码.我需要从带有id friend1的div到带有id 的div 绘制一条线friend2.
<div style="top:30px;left:95px" id="friend1" original-title="Rafael Rosenberg1">
<a href="./profile.php?id=1"><img src="http://graph.facebook.com/100000796250125/picture" border="0" height="50" width="50"/></a>
</div>
<div style="top:30px;left:250px" id="friend2" original-title="Rafael Rosenberg2">
<a href="./profile.php?id=1"><img src="http://graph.facebook.com/100000796250125/picture" border="0" height="50" width="50"/></a>
</div>
Run Code Online (Sandbox Code Playgroud) 我在页面上有几个隐藏的div,其中一些具有相同的类.
<div class="chapter-1"></div>
<div class="chapter-1"></div>
Run Code Online (Sandbox Code Playgroud)
我这样做的前缀是我的班级.如何让所有这些显示?我试过了
var id = 1; // get this from other source
$('.chapter-' + id).each().show();
Run Code Online (Sandbox Code Playgroud) 作为初学者,我似乎无法捕捉到这里误入歧途的东西.我删除了一些代码,以显示错误来自这个简单的语法:
主要:
#include <iostream>
#include <vector>
using namespace std;
class Grader
{
public:
Grader( );
void addScore( int score )
{
vectorofints.push_back(score);
}
vector<int> vectorofints;
};
int main()
{
Grader g;
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我试图从一个元素中删除一个事件处理程序,附加jQuery on()并删除它off().这通常会起作用,但在这种情况下它不起作用.
this.element.on('click', this.handler);
this.element.off('click', this.handler);
Run Code Online (Sandbox Code Playgroud)
这将工作,但在我的情况下,它不起作用,因为将范围绑定到处理程序.
this.element.on('click', this.handler.bind(this));
this.element.off('click', this.handler.bind(this));
Run Code Online (Sandbox Code Playgroud)
由于范围被绑定到处理程序,因此该off方法无法从该元素中分离事件.
我尝试过使用引用,如下所示:
var self = this;
this.element.on('click', this.handler.bind(self));
this.element.off('click', this.handler.bind(self));
Run Code Online (Sandbox Code Playgroud)
但没有运气......任何人都有想法解决这个问题?
我有两节课:
有一个我不明白的错误:
<?php
class database {
private $dbname = "class";
private $dbuser = "soroush";
private $dbpass = "passwprd";
private $dbhost = "localhost";
public $sql;
function __construct() {
$this->sql = new mysqli($this->dbhost, $this->dbuser, $this->dbpass, $this->dbname) ;
}
}
class query extends database {
public static function GetStudentDetail() {
$query = $this->sql->query("SELECT * FROM user"); // error thrown here
$row = $query->fetch_assoc(); return $row;
}
}
var_dump(query::GetStudentDetail());
?>
Run Code Online (Sandbox Code Playgroud)
抛出错误:
致命错误:在第12行的/var/www/html/lib/query.php中不在对象上下文中时使用$ this
有没有之间的差异.ajaxSubmit()和.submit()?已经.submit()取代.ajaxSubmit()?