javascript get callback from method [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm using the cameratag js library functions and am wondering how I get the callback response from them (for example the publish() function). Similar to how you would get the response from an ajax call. I'm pretty novice at javascript.

that is not javascript or jquery, that response will be sent to your server after you upload a video, you will receive a POST request to a specified URL in YOUR server which will include that JSON inside the request body. What you have to do is to parse the JSON and process it in your server function, for example, save the info in your database

Related

Check if object is deletable [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm at the moment making an angular webapplication with an REST api. I'm having a list of object which I request from my REST api. I've implemented a delete function to delete object from the list with a delete request. What I'd also like to implement is a check function which is able to check those objects before they are deleted if it is even possible to delete them but I don't know how to do this. Does anybody know how to write such a check function?
You'll need 'some other way' to communicate this type of information to a client. Your API could for instance just add a deletable property on the resource, determined by the server.
If you're looking for more of a standards approach, you could also implement an OPTIONS requests that returns an Allow header that contains a list of HTTP methods that the client may execute.

Handling Eventsource using PHP and C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have created a fileWatcher(running as a service) in C# which calls PHP script through URL whenever there is a change in Folder.
I want to load the web page with new data when there is change in file.
I have tried doing this using javascript Eventsource by calling PHP and echoing by C# whenever there is change in file but no luck.
Any suggestions how would I tackle this problem.
I have solved this problem by checking file size every minute and responding to event source. Only overhead is checking file every 1 minute.

How to send data from web to api? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Sorry for question but I don't understand that.
I have this:
<a #click.prevent="Submit(0)" href="#">NO</a>
<a #click.prevent="Submit(1)" href="#">OK</a>
Now in my vue method submit I want to post value 0 or 1 to my api and then store it in database. I have controller UserVote and model Vote. I am green here.
How my link should do? Where I post that? How I can upload that to db? I need just know, then I will be know everything.
You can create a method in VueJS that does a API request to some endpoint in your Laravel application. Just send the data to your endpoint and let the PHP controller handle the transmitting to the database.

Create Html template document from Javascript and Php variables [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am developping an application. As final result the application generates a Html document consisting of variables from external Javascript and Php files.Which is the safest way to pass these variables?.
Thank you very much.
You can use AJAX to do this, you make the request in JS, and process the information in PHP(server side), and you can return an JSON Object with the variables, or simply, return the HTML code and output it.
Hope it helps :D

Load files with JSON [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is it possible to load several data files (file1.xml, file2.xml, file3.xml,..) with
jQuery.getJSON
My objective is to load data in an application which is based on JQuery+HTML5.
If your data is in the same domain as the javascript code executing the AJAX request, you can do it by a simple jQuery get request:
$.get("/url-to-source",function(response){
//do what ever you want to do with response
});
If the data resides in a different domain than your javascript code, you should use jsonp, see examples:
http://www.jquery4u.com/json/jsonp-examples/

Categories

Resources