Comments (8)
Not necessarily, this is more or less a design decision on your part to determine if you would prefer your server to do the work on gathering data or if you want your client's browser to do the work to gather the data. However if you want to move to your client gathering data(ajax) a small refactor(code rewrite) would be beneficial to your project as you gain no benefit from your db.php once you move to using an Ajax call.
I see that you also have an issue open for refactoring to VueJS. When this issue is picked up would be a good time to refactor the way your client is served content from curl to an ajax call.
from condense.press.
The rest api is available at https://github.com/agnelvishal/Condense.press/tree/master/rest-api
from condense.press.
pull request has been submitted.
from condense.press.
Hello @LegacyStackCrash Will it be possible to use ajax instead of curl?
from condense.press.
@agnelvishal it is possible to produce the same functionality using ajax instead of curl. However I would highly recommend a small refactor if you want to move over to ajax. Additionally some other things to consider is that by moving to an AJAX call you will now be subject to CORS. While this is not an issue when your client and server are on the same host. It can become a little confusing if you choose to serve your server from say "example.com" but then serve your client page from "example2.com".
from condense.press.
By refactor, is it meant that the code for high charts and cards have to be moved from server to client?
from condense.press.
In this case that is correct. Currently your HTML and JS is intertwined with your PHP which is okay for the approach for the way it currently works. However you would not really want to leave the extra overhead of PHP on the client side rendering if you are going to utilize ajax to request the data from the front end.
from condense.press.
So in this case ajax is a bad idea?
from condense.press.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from condense.press.