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 2 years ago.
Improve this question
If I need to interact with a web API for making HTTP requests like POST and GET, would a javascript program be a better option or a PHP one?
It's totally based on your choice. Javascript is a client side language and PHP is a server side language. If you look for your page not to load for an API call, front end frameworks like Angular can help performing crud operations with a good user experience. In case you wish to use PHP, you can simply use JavaScript (Ajax), which again is a good choice for user experience to call a server side script (PHP), and then perform crud operations from there.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am building a web application with Django and I show the graphs in the website. The graphs are obtained from real time websites and is updated daily. I want to know how can I send graphs using matplotlib to template and add refresh option with javascript which will perform the web scraping script which I have written. The main question is which framework should I use? AJAX, Django REST, or what?
You're better off using a frontend framework and calling the backend for the data via JS. separating the front and backend is a more contemporary approach and has some advantages over doing it all in the backend.
From personal experience, it gets really messy mixing Python and JS in the same system.
Use Django as a Rest-ful backend, and try not to use AJAX in the frontend, then pick a frontend of your choice to deliver the web app.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm starting a project that will use a search bar to hit a web api and return the results. There will be no writing to the web api.
My biggest struggle when creating a new project is how it should be laid out. I never know when i should create a DAO, do it all via javascript, put it in a controller, etc.
For developing something like a search engine or any web application. You would need following:
A frontend, which is your application's GUI in browser of user or mobile application.
A backend logic, this could be in any server side scripting language, in your case you would be writing server code in .net
Now, your backend must expose a search api, Eg. If I send a HTTP GET with a variable q, it should return search results matching the query.
Your frontend must have input-box and a button for allowing users to send this request.
This answer isn't complete, just a vague overview of how this problem can be approached, also this isn't the only solution.
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 making my own website and I've never really done it before. I am familiar with each of the separate parts, but I've never put them all together before.
I want to have html and javascript on the front end. This would send HTTP requests to my PHP on the backend. The PHP would then have an open socket with my java server that would store data in mysql or mongodb.
javascript client, PHP backend, Java server, mysql/mongo database.
Is this the appropriate way to set up a restful api in a general sense? If not, how should I do it?
You have it right. Javascript on the front end and PHP on the backend is an incredibly popular and powerful combination. The Apache server seems to be more popular among PHP users, but a java server works just fine.
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
how can I communicate javascript with C++, run some commands, get active processes, but I didn't find any information on the web.
What I saw is the following links but none helps me:
http://comunidad.aisoy.es/api/Communication.html
http://www.mosync.com/docs/sdk/js/guides/wormhole/extending-javascript-with-cpp/index.html
http://www.codeguru.com/cpp/i-n/ieprogram/article.php/c4399/JavaScript-Calls-from-C.htm
Based on your tiny requirements description, here's a brief overview:
Run your C++ code as a stripped down version of http server, OR better write a C++ apache module. Make your javascript to make AJAX request to the exposed URL by the C++ http server, return the response in JSON/XML.
Just the standard way for your UI (javascript) to speak to the backend (C++)
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
I'm trying to make a web application which uses a mobile phone as a controller (an example of this kind of thing: http://chrome.com/supersyncsports/). It isn't something very complicated, I just need to send text which was entered in the phone to the computer. I don't need any database, I just need to send text from one device to another. Is there a way to do this with AJAX and without PHP?
Thanks,
bhc11
This is possible but it's not simple. You will need to setup a browser-to-browser peer-to-peer connection.
See WebRTC and Wikipedia for a high overview of the technology.
You are going to need some server back-end to process this. You will make your ajax call to the server which reads and determines the location to send the text on to. Since you are using mobile, you will need to either send a push notification to the second user, or you need to have the users polling for new content.