如何在提交按钮单击后重定向用户?我的javascript无效:
使用Javascript
<script type="text/javascript" language="javascript">
function redirect()
{
window.location.href="login.php";
}
</script>
Run Code Online (Sandbox Code Playgroud)
表单页面
<form name="form1" id="form1" method="post">
<input type="submit" class="button4" name="order"
id="order" value="Place Order" onclick="redirect();" >
</form>
Run Code Online (Sandbox Code Playgroud) 我已经使用了html5标头标签和h1标签.在我的标题中的h1元素的上边距属性设置为0px后,我设法删除标题的上边距,但我希望我的标题内的h1元素具有大约15px的上边距.
现在,当我尝试设置h1元素的上边距时,它还会为我不想要的标题创建一个上边距.
有人可以帮我解决这个问题吗?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="normalize.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<title>Codename : ENT</title>
</head>
<body>
<header>
<h1>Site Title / LOGO</h1>
<p>Site Tagline / Slogan / One liner.</p>
<p></p>
<nav></nav>
</header>
<div id="content_wrapper"></div>
<footer>
</footer>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
和CSS
header {
background-color:#ff0
}
header h1 {
margin-top:0;
margin-left:15px
}
header p {
margin-left:15px
}
Run Code Online (Sandbox Code Playgroud) 我试图找到一种简单的方法来升级我的CentOS5机器上的PHP yum而不是下载源代码并自己再次编译它(我上次做了,但是很难让所有的编译配置与CentOS的默认配置相同).无论如何,我最终使用这里列出的方法:http:
//www.atomicorp.com/wiki/index.php/PHP
现在,该命令php -v显示版本已经是5.2.11(我需要),但它总是包含许多警告,如:
PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: …Run Code Online (Sandbox Code Playgroud) 我现在已经搜索了几个小时,找不到解决问题的可行方案,所以我可以给你一些建议.
我想要的是一个包裹在里面的一些浮动div的div.包装高度对我来说没有问题,但是如果将浏览器调整为宽度(浮动元素向下跳跃),则宽度不会正确换行.
这里有一些示例代码:
HTML:
<div class="wrapper">
<div class="block1">
</div>
<div class="block2">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
body {
border: solid 1px green;
}
.wrapper {
border: solid 1px red;
display: table;
}
div {
display: block;
}
.block1 {
float: left;
width: 390px;
height: 390px;
background-color: blue;
}
.block2 {
float: left;
width: 390px;
height: 390px;
background-color: yellow;
}
Run Code Online (Sandbox Code Playgroud)
所以基本上我希望包装div总是具有div内部所需的宽度.通过调整窗口大小并让右边的div跳到左边,包装div现在应该具有390px的宽度.
我需要这个解决方案用于我想要的响应式网站,我需要尽快.
首选纯CSS解决方案,但JS或jquery也会这样做.
我不擅长C++(但我熟悉OOP/Java),但我必须为我的C++类创建一个游戏.我想设置一种类似于用ActionScript编写的Flash游戏的游戏引擎.
我写了这两个类,其中Actor是一个基类(可能是抽象的),Player实际上应该实现它.
问题是,我想,以避免功能重复的代码addEventListener和handle并重新申报_handlerMap,因为我要实现数据隐藏和这样的事情.
我想,问题是_eventMap应该包含handler可以改变类Actor::*handler和的值Player::*handler.可能吗?
class Actor {
protected:
typedef void(Actor::*handler)(Event);
map<int, handler> _handlerMap;
public:
virtual void addEventListener(int ID, handler h) {
_handlerMap.insert(std::make_pair(ID, h));
};
virtual void handle(int ID) {
handler h = _handlerMap[ID];
Event e;
if (h)
(this->*h)(e);
}
virtual void onUpdate(Event e) {
cout << "Actor::onUpdate()" << endl;
};
};
class Player : public Actor {
typedef void(Player::*handler)(Event);
map<int, …Run Code Online (Sandbox Code Playgroud) 我在tomcat7上收到此错误.
信息:检测到单个请求([10,000])的最大请求参数数(GET加POST).超出此限制的任何参数都被忽略.要更改此限制,请在Connector上设置maxParameterCount属性.
任何人都可以告诉我,如果我可以修改maxParameterCount,如果可以,如何?
我有一些html表,读起来像
<table>
<tr>
<td>
<input type="text" class="myclass" name="first_ele[]" value="100" />
</td>
<td>
<input type="text" class="anotherclass" name="secon_ele[]" value="" />
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我有一个jquery,它将获取包含类"myclass"的元素的值,并且我获得了正确的值.我需要获取下一个输入元素的值.仅供参考,表格会动态添加行.我的问题是我不知道如何指向下一个可用的输入元素.
我的jquery获取具有类"myclass"的元素如下.
$('.tInputd').keyup(function(){
var disc = $(this).val();
});
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助.
我有一个div:
<div id="picture_contents_12356_title"></div>
Run Code Online (Sandbox Code Playgroud)
'12356'是一个自动生成的唯一ID,我需要在那里拥有它.如何为具有"picture_contents"和"title"的id创建jQuery选择器?
我知道你可以做[id*="picture_contents"]但我也需要检查它是否包含"标题".如何在那里创建AND逻辑?
我想也许可以将id提取到变量并检查indexOf("picture_contents"),indexOf("title")但我想知道是否有更好的方法.
我想让我的divs相互滚动,没有它们向上滚出屏幕.
我用两个div来管理这个,但不能设法用第三个做同样的事情.
我在jsFiddle上做了一个例子:http://jsfiddle.net/gv8GU/ 所以当你这样做时它会起作用:
#one{
width: 100%;
height: 800px;
position: fixed;
background: gold;
}
#two{
width: 100%;
height: 800px;
top: 800px;
position: relative;
background: goldenrod;
}
#three{
width: 100%;
height: 200px;
top: 800px;
position: relative;
background: darkgoldenrod;
}
Run Code Online (Sandbox Code Playgroud)
但这仅适用于前两个div.
因此,当第二个div(#two)一直滚动到顶部并进一步滚动时,我希望第二个div保持在顶部,在第二个div上滚动第三个div(#three).