Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

javascript - Getting the following code to work in both Chrome and Safari -


can't seem figure out why works in safari not in chrome. appreciated.

//create or use existing db var db = opendatabase('mytest', '1.0', 'myspecialdatabase', 200000);  if (db) {   //new transaction   db.transaction(function (tx) {   tx.executesql('drop table if exists foo');       tx.executesql('create table if not exists foo (id unique, text)');   //insert test data   tx.executesql('insert foo (id, text) values (1, "mytest")');   tx.executesql('insert foo (id, text) values (2, "another")');   tx.executesql('insert foo (id, text) values (3, "andyetanother")');   tx.executesql('insert foo (id, text) values (4, "ohandagain")');     });     alert("db success");       } else {     alert("oooops"); }  db.transaction(function (tx) {     // loop rows of db, print values     tx.executesql('select * foo',[], function (tx, results) {         var rows = results.rows;         alert(rows.length);         (var index = 0; index < rows.length; index++) {             var x = rows.item(index);             alert(x.text);         }     }); }); 

throw in jsfiddle in either browser, works intended in latest release of safari no such luck in chrome.

edit

i managed working in end - code can seen below.

var db = opendatabase('cbdb', '1.0', 'myspecialdatabasethatwontwork',10*1024*1024);  db.transaction(function (tx){  tx.executesql('drop table if exists cb');  alert("dropped table");  createdb();  querydb(); }, function (tx, error) {     // error     alert('0.something went wrong: '+ error.message); });  function createdb(){     db.transaction(function (tx) {                tx.executesql('create table if not exists cb (id unique, text)');         tx.executesql('insert cb (id, text) values (1, "mytest")');         tx.executesql('insert cb (id, text) values (2, "another")');         tx.executesql('insert cb (id, text) values (3, "andyetanother")');         tx.executesql('insert cb (id, text) values (4, "ohandagain")');         alert("db success");           },         function (tx, error) {             // error             alert('1.something went wrong: '+ error.message);         }); }  function querydb(){     db.transaction(function (tx) {         tx.executesql('select * cb',[], function (tx, results) {             var rows = results.rows;             alert(rows.length);             (var index = 0; index < rows.length; index++) {                 var x = rows.item(index);                 alert(x.text);             }          },         function (tx, error) {         // error         alert('2.something went wrong: '+ error.message);         });     }); } 

updated code slightly, , works..

var db = opendatabase('cbdb', '1.0', 'myspecialdatabasethatwontwork',10*1024*1024);  db.transaction(function (tx){  tx.executesql('drop table if exists cb');  alert("dropped table");  createdb();  querydb(); }, function (tx, error) {     // error     alert('0.something went wrong: '+ error.message); });  function createdb(){     db.transaction(function (tx) {                tx.executesql('create table if not exists cb (id unique, text)');         tx.executesql('insert cb (id, text) values (1, "mytest")');         tx.executesql('insert cb (id, text) values (2, "another")');         tx.executesql('insert cb (id, text) values (3, "andyetanother")');         tx.executesql('insert cb (id, text) values (4, "ohandagain")');         alert("db success");           },         function (tx, error) {             // error             alert('1.something went wrong: '+ error.message);         }); }  function querydb(){     db.transaction(function (tx) {         tx.executesql('select * cb',[], function (tx, results) {             var rows = results.rows;             alert(rows.length);             (var index = 0; index < rows.length; index++) {                 var x = rows.item(index);                 alert(x.text);             }          },         function (tx, error) {         // error         alert('2.something went wrong: '+ error.message);         });     }); } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -