I have created a simple jquery example. On loading, the script should cause h1 tag to disappear from view, this however, is not happening.
I believe I have placed the scripts in the correct location, and in the right order. Please see below for markup and script:
$Import
<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script>
<script src="test.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1> JS</h1>
<div id="top">
<h1> JS</h1>
</div>
<section id="grid">
<table
<tr>
<td><a href="#">About</a></td>
<td><a href="#">Machinery</a></td>
<td><a href="#">Gallery</a></td>
</tr>
</table>
</section>
</body>
});
答案 0 :(得分:-1)
Looks like you have a couple of typos. Instead of curly brackets, document ready should be used like this in jQuery:
static void shuffleArray(string[] ar)
{
//set the seed for the random variable
Random rnd = ThreadLocalRandom.current();
//go from the last element to the first one.
for (int i = ar.size()- 1; i > 0; i--)
{
//get a random number till the current position and simply swap elements
int index = rnd.nextInt(i + 1);
// Simple swap
int a = ar[index];
ar[index] = ar[i];
ar[i] = a;
}
}
Also in your html you are not closing your opening $(document).ready();
tag.