GithubHelp home page GithubHelp logo

Comments (8)

devdadmax avatar devdadmax commented on August 24, 2024 1

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.

agnelvishal avatar agnelvishal commented on August 24, 2024

The rest api is available at https://github.com/agnelvishal/Condense.press/tree/master/rest-api

from condense.press.

devdadmax avatar devdadmax commented on August 24, 2024

pull request has been submitted.

from condense.press.

agnelvishal avatar agnelvishal commented on August 24, 2024

Hello @LegacyStackCrash Will it be possible to use ajax instead of curl?

from condense.press.

devdadmax avatar devdadmax commented on August 24, 2024

@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.

agnelvishal avatar agnelvishal commented on August 24, 2024

By refactor, is it meant that the code for high charts and cards have to be moved from server to client?

from condense.press.

devdadmax avatar devdadmax commented on August 24, 2024

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.

agnelvishal avatar agnelvishal commented on August 24, 2024

So in this case ajax is a bad idea?

from condense.press.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.