我有一个简单的顶级栏使用jQuery,如Stack Overflow上的那个,但我希望它只出现在第一次有人访问网站时.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="bxSlider.js"></script>
<title>topbar</title>
<style type="text/css" media="screen">
#message {
font-family:Arial,Helvetica,sans-serif;
position:fixed;
top:0px;
left:0px;
width:100%;
z-index:105;
text-align:center;
color:white;
padding:2px 0px 2px 0px;
background-color:#8E1609;
}
#example1 {
text-align: center;
width: 80%;
}
.close-notify {
white-space: nowrap;
float:right;
margin-right:10px;
color:#fff;
text-decoration:none;
padding-left:3px;
padding-right:3px
}
.close-notify a {
color: #fff;
}
h4, p {
margin:0px;
padding:0px;
}
</style>
</head>
<body>
<DIV ID='message' style="display: none;">
<DIV ID="example1">
<DIV CLASS="item">
<h4>Head …Run Code Online (Sandbox Code Playgroud) 我试图将div按钮居中,但它不起作用
这是css
.game-actions{
margin-left:auto;
margin-right:auto;
}
.game-actions a.up {
display: block;
text-decoration: none;
font-weight: bold;
padding:12px 32px;
float: left;
border: 1px solid #c1d9f6;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
}
.game-actions a:hover {
border-color: #80b0ea;
background:#e1ecf3;
}
Run Code Online (Sandbox Code Playgroud)
这是html
<div class="game-actions">
<a class="up" id="a1" href="#" onClick="toggle(this.value)">Tweet it</a>
</div>
Run Code Online (Sandbox Code Playgroud)
网站位于 - http://gibberize.com/
我有一个索引页面,我希望它包含一个名为splash.php的页面,而不是display.php,当用户登陆index.php时,但是一旦用户做某事(设置变量),即用户搜索(变量")查询")我希望它包含display.php而不包括splash.php
这段代码有什么问题?
function hasGet()
{
return !empty($_GET['fact']);
return !empty($_POST['query']);
}
if (hasGet()) {
include("display.php");
}
else {
include("splash.php");
}
Run Code Online (Sandbox Code Playgroud)
这个问题应该删除
我在哪里错了
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>title</title>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
$.get("http://api.angel.co/1/tags/1654/startups?callback=aaa",
function(data) {
$('body').append( "Name: " + data );
}, "json");
</script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
XMLHttpRequest无法加载http://api.angel.co/1/tags/1654/startups?callback=aaa.Access-Control-Allow-Origin不允许使用null.
在我的网站www.gibberize.com上,如果您在顶部文本区域中输入单词"and",则字符"&"将出现在第二个textarea中.
问题是"tweet it"链接会将第二个textarea的文本附加到URL并继续链接,但因为它是一个&符号,它会破坏文本.
有解决方案吗
我正在尝试创建一个脚本,当您键入十六进制值并按提交时,它会将文本颜色更改为输入的颜色.
似乎问题是我在变量new html中调用变量"userInput"的方式
有任何想法吗?
<script type="text/javascript">
function changeText3(){
var userInput = document.getElementById('userInput').value;
var oldHTML = document.getElementById('para').innerHTML;
var newHTML = "<span style='color:userInput'>" + oldHTML + "</span>";
document.getElementById('para').innerHTML = newHTML;
}
</script>
<p id='para'>Welcome to the site <b>dude</b> </p>
<input type='text' id='userInput' value='#' />
<input type='button' onclick='changeText3()' value='Change Text'/>
Run Code Online (Sandbox Code Playgroud)