瀏覽代碼

Fixed bug in endsWith() function

bmallred 12 年之前
父節點
當前提交
80734cb0d0
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      example.html
  2. 1 1
      jquery-analytics.js

+ 2 - 1
example.html

1
<!doctype html>
1
<html>
2
<html>
2
<head>
3
<head>
3
4
	<title>jQuery Analytics Example</title>
4
</head>
5
</head>
5
<body>
6
<body>
6
	<h1>jQuery Analytics</h1>
7
	<h1>jQuery Analytics</h1>

+ 1 - 1
jquery-analytics.js

31
// @param {String} search
31
// @param {String} search
32
// @return {Boolean} a value indicating whether the string ends with the search criteria
32
// @return {Boolean} a value indicating whether the string ends with the search criteria
33
String.prototype.endsWith = function (search) {
33
String.prototype.endsWith = function (search) {
34
    return original.lastIndexOf(search) == original.length - search.length;
34
    return this.lastIndexOf(search) == this.length - search.length;
35
};
35
};
36
36
37
(function ($) {
37
(function ($) {