javascript - Starting with phone gap -


I am very new to phone difference. I am building a terminology app as a project.

This is like 1 page if I select an alphabet and on the next page it should display the words starting with that alphabet. I am facing problems in displaying only words starting with that particular alphabet, which was clicked on the previous page. How can i do it ???

  Function OnDevice Readie () {if () {document.getElementById ("word") InnerHTML = "abase"; . Document.getElementById ("options") innerHTML = "low, down"; }}  

This is the second page's code. What should I pass in the loop? And how do I show it below

  & lt; Table name = "tb1" border = "2" & gt; & Lt; TR & gt; & Lt; TD & gt; The word & lt; / TD & gt; & Lt; TD & gt; Options & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td id = "word" & gt; & Lt; / Td> & Lt; Td id = "options" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt;  

You can use HTML5 local storage feature And it works

(1) First enter the word or character in the local storage

  var word = document.getElementById ("word"). Value; LocalStorage.setItem ("Keyword", JSON.stringify (word)); On the second page,  

(2), get it back.

  var a = JSON.parse (localStorage.getItem ("keyword"));  

Using local storage, you can also add another feature to your app to show the history of last entered words. Simply create an array in the local storage and use it to keep the user input.

Later to clear all data from local storage.

  localStorage.clear ();  

Edit: In order to know which button (the letter) was chosen by the user, you will need to create a function that defines the label or value Click on the Receive button and then save it to the local storage mentioned above. Once done, change the page to retrieve the archived items and show results accordingly.

For example:

  // select Save first page function below () {var word = document.getElementById ("charA ") Is required to run inside value; // charA is a button ID or value ... above it you use either ID or value to identify the local characters .set ITM ("keyword", JSON.stringify (word)); }  

On the second page:

  function show word () {var char = JSON.parse (localStorage.getItem ("searchword")); // Now search in your dictionary object and show resultsInDictionary (char) results; }  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -