Git Product home page Git Product logo

Comments (6)

metabrain avatar metabrain commented on June 16, 2024

I will do this tomorrow !

from raspberry-pi-heartbeat.

metabrain avatar metabrain commented on June 16, 2024

I don't think we can put the JS in a .js file since we are using our PHP functions to fill out the javascript arrays... I'll mark it closed because I don't think it can be made. Now index.php is much more clean, so I don't think the inline JS is that big of a problem.

from raspberry-pi-heartbeat.

geekbeard avatar geekbeard commented on June 16, 2024

but can we wrap the graph stuff into functions, with php insert arrays into javascript as vars and call for function passing that var....)). ?

but it might be not worth it:)

from raspberry-pi-heartbeat.

metabrain avatar metabrain commented on June 16, 2024

I don't think you can since .js files are loaded by the browser, not the server, so you can't inject PHP arrays there.

from raspberry-pi-heartbeat.

geekbeard avatar geekbeard commented on June 16, 2024

Wont ia work like that:

<script> </script> <script link="plotgraph.js"></script>

So the js file has a function and php inserts the var and the call for that
function. Though the order should be different, first load the js file then
goes the var and the call i guess)

Cant try that myself now. Only by the end of this week.
On Jun 29, 2013 5:52 PM, "Daniel Parreira" [email protected] wrote:

I don't think you can since .js files are loaded by the browser, not the
server, so you can't inject PHP arrays there.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-20232139
.

from raspberry-pi-heartbeat.

metabrain avatar metabrain commented on June 16, 2024

Yes, but that way the JS code has to be in the same .php file or another PHP file: not very clean IMHO ;)

from raspberry-pi-heartbeat.

Related Issues (11)

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.