Comments (6)
I will do this tomorrow !
from raspberry-pi-heartbeat.
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.
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.
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.
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.
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
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 raspberry-pi-heartbeat.