| 88 | img.src = src; |
| 89 | } |
| 90 | function _ec_replace(str, key, value) { |
| 91 | if (str.indexOf("&" + key + "=") > -1 || str.indexOf(key + "=") === 0) { |
| 92 | // find start |
| 93 | var idx = str.indexOf("&" + key + "="), |
| 94 | end, newstr; |
| 95 | if (idx === -1) { |
| 96 | idx = str.indexOf(key + "="); |
| 97 | } |
| 98 | // find end |
| 99 | end = str.indexOf("&", idx + 1); |
| 100 | if (end !== -1) { |
| 101 | newstr = str.substr(0, idx) + str.substr(end + (idx ? 0 : 1)) + "&" + key + "=" + value; |
| 102 | } else { |
| 103 | newstr = str.substr(0, idx) + "&" + key + "=" + value; |
| 104 | } |
| 105 | return newstr; |
| 106 | } else { |
| 107 | return str + "&" + key + "=" + value; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | function idb() { |
| 112 | if ('indexedDB' in window) { |