Fejlen i chrome ser sådan her ud:
http://i47.tinypic.com/ojqctt.jpgher er hele scriptet:
- function ListExtender(container, extendButton, extendSize) {
- this.container = container;
- this.extButton = extendButton;
-
- this.skipSize = 0;
- this.extendSize = extendSize;
- }
-
- ListExtender.prototype.init = function () {
- $.ajax({
- type: 'get',
- url: 'WebService.asmx/GetEmployeesBySkipAndExtend',
- data: { skipSize: this.skipSize, extendSize: this.extendSize },
- dataType: 'json',
- contentType: "application/json; charset=utf-8",
- success: function (data) {
- $.each(data.d, function (i, item) {
- var listItem = $('<div></div>', { class: 'row' });
-
- $('<div></div>', {
- text: item.Name,
- class: 'name'
- }).appendTo(listItem);
-
- $('<div></div>', {
- text: item.Age,
- class: 'age'
- }).appendTo(listItem);
-
- $('<div></div>', {
- text: item.City,
- class: 'city'
- }).appendTo(listItem);
-
- $('<div></div>', {
- text: item.Sex,
- class: 'sex'
- }).appendTo(listItem);
-
- $('<div></div>', {
- text: item.PositionID,
- class: 'position'
- }).appendTo(listItem);
-
- listItem.appendTo(this.container);
-
- this.skipSize += this.extendSize;
- });
- }
- });
- }
Tilhørende script:
- <script src="js/jquery-1.8.0.min.js" type="text/javascript"></script>
- <script src="js/employeeListExtender.js" type="text/javascript"></script>
- <script type="text/javascript" language="javascript">
- var listExtender = new ListExtender($('#employee-list'), $('#extend-employee-list'), 2);
-
- listExtender.init();
- </script>
synes bare det burde virke det skidt