Answer the question
In order to leave comments, you need to log in
How to send queries to the database from webview application?
Hello, maybe a stupid question, but asking it is the fastest way to figure it out.
I am learning to create an android webview application (using cordova) and I have a need to tie a database to the application.
The question is: How can I do this, because the application is not hosted, php + mysql here, as I understand it, will not work.
Answer the question
In order to leave comments, you need to log in
You need to use AJAX requests, because. php files cannot be executed inside a cordova application. Here is an example:
$(document).ready(function() {
$('#singup').submit(function(e){
e.preventDefault();
$.ajax({
type: 'POST',
url: 'singup.php', //тут ссылка на файл на сервере
data: $(this).serialize(),
}).done(function() {
alert("Успешно!");
});
return false;
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question