为什么我有错误?
我的代码:
var idb = window.indexedDB || // Use the standard DB API
window.mozIndexedDB || // Or Firefox's early version of it
window.webkitIndexedDB; // Or Chrome's early version
var IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;
var IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;
var dbName='nameDb';
var idbRequest=idb.open(dbName,'4.67' /*,dbDescription */);
idbRequest.onsuccess=function (e) {
debugger
var db=e.target.result;
if (!db.objectStoreNames.contains('chat')){
co=db.createObjectStore('chat',{'id':100});
};
if (!db.objectStoreNames.contains('iam')){
co1=db.createObjectStore('iam');
};
};
idbRequest.onerror = function (e) {
debugger
};
Run Code Online (Sandbox Code Playgroud)
未捕获的InvalidStateError:无法在"IDBDatabase"上执行"createObjectStore":数据库未运行版本更改事务.index.html:37 idbRequest.onsuccess
什么是Window?
这是我在Chrome控制台上看到的内容:
window
Window {top: Window, window: Window, location: Location, external: Object,
chrome: Object…}
Window
function Window() { [native code] }
Run Code Online (Sandbox Code Playgroud) 如果SQL语句中有任何错误,系统将自动回滚更改,如何启动事务?
用PHP
try {
// First of all, let's begin a transaction
$db->beginTransaction();
// A set of queries; if one fails, an exception should be thrown
$db->query('first query');
$db->query('second query');
$db->query('third query');
// If we arrive here, it means that no exception was thrown
// i.e. no query has failed, and we can commit the transaction
$db->commit();
} catch (Exception $e) {
// An exception has been thrown
// We must rollback the transaction
$db->rollback();
} …Run Code Online (Sandbox Code Playgroud) 有什么区别layout:'hbox'和layout:'column'?它只是语法吗?
示例' 列 ':
layout:'column',
items: [{
title: 'Width = 25%',
columnWidth: .25,
html: 'Content'
},{
title: 'Width = 75%',
columnWidth: .75,
html: 'Content'
},{
title: 'Width = 250px',
width: 250,
html: 'Content'
}]
Run Code Online (Sandbox Code Playgroud)
示例' hbox ':
layout: {
type: 'hbox',
pack: 'start',
align: 'stretch'
},
items: [
{html:'panel 1', flex:1},
{html:'panel 2', width:150},
{html:'panel 3', flex:2}
]
Run Code Online (Sandbox Code Playgroud) 什么时候
<html ng-app="myApp">
Run Code Online (Sandbox Code Playgroud)
然后我得到模块:
angular.module('myApp', []);
var mod = angular.module('myApp')
mod.controller('MyController',
function ($scope) {})
Run Code Online (Sandbox Code Playgroud)
我对如何选择默认模块感兴趣 <html ng-app>
什么是presence类型验证?
validations: [{
type: 'presence',
field: 'age'
}]
Run Code Online (Sandbox Code Playgroud)
请帮助说明示例.
在一本书中,我看到了这种语法:
SELECT * FROM inw WHERE id IS DISTINCT FROM 4;
Run Code Online (Sandbox Code Playgroud)
但是我收到一个错误:
错误1064(42000):您的SQL语法有错误; 检查与MySQL服务器版本对应的手册,以便在第1行的'DISTINCT FROM 4'附近使用正确的语法
它是另一种选择:
mysql> SELECT * FROM inw WHERE id is null OR id <> 4;
+------+
| id |
+------+
| NULL |
| NULL |
| 3 |
+------+
Run Code Online (Sandbox Code Playgroud)
'IS DISTINCT FROM'是一个真正的MySQL运营商吗?
在我的固定版本网站中,我有:
<object type="application/x-shockwave-flash" data="uppod.swf" width="560" height="370">
Run Code Online (Sandbox Code Playgroud)
item标签如何<object>响应?
object{
width:100%;
max-height:100%;
}
Run Code Online (Sandbox Code Playgroud)
它不起作用.
如何改变属性width="560" height="370"?
我读了如何在JavaScript中清空数组的主题?
答案:
非常简单:
A = [];
我对Daniel Baulig的评论感兴趣:
这不会清空数组,而是创建一个新的空数组.这可能会导致问题,尤其是在存在对阵列的其他引用时.OP:请考虑接受马修的答案.这是更清洁和正式的正确方法. - Daniel Baulig 2011年1月19日13:08
你能告诉我这可能导致什么问题吗?