at first i ran this code on php file and run it on localhost using WampServer. the pagination didn’t work so i tried to convert it to html file (“sample.html”). the code here as follows.
<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="js/easypaginate.js"></script>
<script type="text/javascript">
jQuery(function($){
$('ul#items').easyPaginate({
step:5
});
});
</script>
<style>
#page li {
display: inline;
position: relative;
width: 11em
margin:10px;
padding:10px;
}
#page li li{ display: block; height: 1.5em;}
</style>
<div id = "page">
<ul id="items">
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
<li>Page 4</li>
<li>Page 5</li>
<li>Page 6</li>
<li>Page 7</li>
<li>Page 8</li>
<li>Page 9</li>
<li>Page 10</li>
<li>Page 11</li>
<li>Page 12</li>
<li>Page 13</li>
<li>Page 14</li>
</ul>
</div>
i transferred this code on sample.html but the case is. the jquery is not working when i ran it on localhost. but when i Open With – > Google Chrome the sample.html file the jquery work. I think the problem is not in the code. the problem occured when i ran the file via localhost even if it is a .html or .php file. help me please T_T
when i ran the code through localhost this output is produced
Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 Page 8 Page 9 Page 10 Page 11 Page 12 Page 13 Page 14
but when i ran it directly on a browser Open With -> Browser
this is the output
Page 1 Page 2 Page 3 Page 4 Page 5
1 2 3 Next
check the source for any errors generated by PHP. it seems you are doing some invalid things in your server side.
http://jsfiddle.net/Zu3Ae/