Page 1 of 1

PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 8:33 am
by Canedje
I tried to use the analog clock from Highcharts. This is not working at PHP on the Raspberry.

Does somebody knows a nice analog clock to present in PHP/ JS on a Rasberry?

Thanks in advance.

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 8:50 am
by DougieLawson
Please post a link to the PHP code you've downloaded.

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 8:55 am
by Canedje
DougieLawson wrote:Please post a link to the PHP code you've downloaded.

I tried to make this code working:
http://jsfiddle.net/gh/get/jquery/1.9.1 ... uge-clock/

I do use other codes from this side which are working

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 8:57 am
by Massi
Canedje wrote:
DougieLawson wrote:Please post a link to the PHP code you've downloaded.

I tried to make this code working:
http://jsfiddle.net/gh/get/jquery/1.9.1 ... uge-clock/

I do use other codes from this side which are working
where is the php?

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 9:35 am
by Heater
PHP is not required to get that working. Just serve up that page.

You will also need a script tga to pull the jquery into your page.

<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>

What errors do you get it the dev tools in Chrome or Firefox browsers?

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 9:38 am
by DougieLawson
Create a file called /var/www/hc.clock.js (with the Javascript analog clock code from that website).

Create a HTML file /var/www/hc.clock.html

Code: Select all

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>Analog clock</title>
    <script src='http://code.jquery.com/jquery-1.9.1.js'></script>
    <script src="http://code.highcharts.com/highcharts.js"></script>
    <script src="http://code.highcharts.com/highcharts-more.js"></script>
    <script src="hc.clock.js"></script>
  <head>
  <body>
    <div id="container" style="width: 300px; height: 300px; margin: 0 auto"></div>
  </body>
</html>
Point your web browser at http://pi.local/hc.clock.html

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 9:39 am
by Massi
Heater wrote:You will also need a script tga to pull the jquery into your page.
betting 5 euros on this :)

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 9:40 am
by DougieLawson
Massi wrote:
Heater wrote:You will also need a script tga to pull the jquery into your page.
betting 5 euros on this :)
You lose. Pay up.

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 9:42 am
by Massi
DougieLawson wrote:
Massi wrote:
Heater wrote:You will also need a script tga to pull the jquery into your page.
betting 5 euros on this :)
You lose. Pay up.
you have to wait for the op to say "oh, i forgot this" :)

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 10:40 am
by Canedje
DougieLawson wrote:Create a file called /var/www/hc.clock.js (with the Javascript analog clock code from that website).

Create a HTML file /var/www/hc.clock.html

Code: Select all

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>Analog clock</title>
    <script src='http://code.jquery.com/jquery-1.9.1.js'></script>
    <script src="http://code.highcharts.com/highcharts.js"></script>
    <script src="http://code.highcharts.com/highcharts-more.js"></script>
    <script src="hc.clock.js"></script>
  <head>
  <body>

    <div id="container" style="width: 300px; height: 300px; margin: 0 auto"></div>
  </body>
</html>
Point your web browser at http://pi.local/hc.clock.html
Thanks for the help.

Indeed it is no PHP code needed. Apologize. :oops:

I'll try at home.
I did put straight the code into my header without the source line you mentioned

There where no errors. The clock just didnĀ“t show up

Re: PHP/ JS ->Show analog clock

Posted: Wed May 06, 2015 12:17 pm
by Heater
This works. See attachment.

Somebody owes me 5 Euro :)