javascript - Local HTML 5 database usable in Mac Dashboard wigdets? -


I am trying to use the HTML5 local database feature on the Mac Dashboard widget. I am programming in the following Javascript Dashcode:

  if (window.openDatabase) {database = openDatabase ("MyDB", "1.0", "Sample DB", 1000); If the database (database) is ... ... the database code is here ...}  

Unfortunately, always calling the database-variable after the call is always empty. I think local databases are not supported in widgets ...

Any thoughts?

/ pom

No, you will not be able to give it up. And even if you still would not be able to distribute the widget without distributing the database, assuming it was a MySQL or SGLite. (Not sure what that means by local DB of HTML5.

Here are several ways: -

You can add a data source that is a JSON file Maybe, or an XML file or RSS feed. For example, to do this with JSON, you will write a page on a server on PHP or in a situation that can access the database so that the URL is called JSON string JSON string can be Pars it up and use it in the widget, you will get the data, but it will not be saved.

There will be another way to use user preferences. Save and Retrieve.

Then change

  var preferenceKey = "key"; with the key for priority preference; value = " Change the value with the priority to save the "//" Rathamikta code widget.setPreferenceForKey (preferenceValue, preferenceKey);  

you

  var preferenceForKey = "key"; Can replace / replace with the key for priority / / priority cod e priority. FORKEY = widget.motionphoric (priority);  

External calls, you can also use the rest to read the data in any quantity and the preferences will allow you to save data for later use, which will avoid logout and shutdown . / P>

The Apple site has a lot of information about widgets and tutorials, as well as the themed work.

Hope this will be helpful.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -