在IE 8中运行以下代码时出错,但在其他浏览器中没有:
'document.head'为null或不是对象
这是我的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<script type="text/javascript" src="respond.min.js"></script>
<script>
function load() {
document.getElementsByID("myFrame");
}
</script>
</head>
<body>
<iframe src="http://instagram.com/p/bTlK6CRNcL/embed/" width="300" height="400" frameborder="0" scrolling="no" allowtransparency="true" id="myFrame" onload="load()"></iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我试图在我的PHP代码中回显提交表单:
我正在尝试以下方法:
// Display results
foreach ($media->data as $data) {
echo "<a href=\"{$data->link}\"</a>";
echo "<h4>Photo by: {$data->user->username}</h6>";
echo $pictureImage = "<img src=\"{$data->images->thumbnail->url}\">";
echo "<h5>Like Count for Photo: {$data->likes->count}</h5>";
echo "<form>";
echo "<form action='tag.php' method='post'>";
echo "<input type='submit' name='submit'>";
echo "</form>";
}
Run Code Online (Sandbox Code Playgroud)
然后:
if(isset($_POST['submit'])) {
echo "hello";
}
Run Code Online (Sandbox Code Playgroud)
这似乎没有回应"你好";
任何帮助,将不胜感激
我正在划分两个值,以便从实际计数和我的应用程序的总计数中获得百分比.
我使用以下公式:
echo ($fakecount / $totalcount) * 100;
Run Code Online (Sandbox Code Playgroud)
这给了我一个像79.2312313的价值.我会提高79%的价值.
我尝试过以下方法:
echo round($fakecount / $totalcount) * 100;
Run Code Online (Sandbox Code Playgroud)
这似乎不正常.
有什么建议?
我试图在Groovy中声明应该返回一个字符串的以下函数.
def String sortCharacters(String string) {
char[] charArray = string.toLowerCase().toCharArray();
Arrays.sort(charArray);
return String.valueOf(charArray)
}
Run Code Online (Sandbox Code Playgroud)
出于某种原因,我在尝试在字符串上使用它时遇到错误.
string1.sortCharacters(string1);
No signature of method: java.lang.String.sortCharacters() is applicable for argument types: (java.lang.String)
Run Code Online (Sandbox Code Playgroud)