Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

PHP/ JS ->Show analog clock

Wed May 06, 2015 8:33 am

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.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 8:50 am

Please post a link to the PHP code you've downloaded.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 8:55 am

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

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 8:57 am

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?

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 9:35 am

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?
Last edited by Heater on Wed May 06, 2015 9:40 am, edited 3 times in total.
Memory in C++ is a leaky abstraction .

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 9:38 am

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
Last edited by DougieLawson on Wed May 06, 2015 9:40 am, edited 1 time in total.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 9:39 am

Heater wrote:You will also need a script tga to pull the jquery into your page.
betting 5 euros on this :)

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 9:40 am

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 9:42 am

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" :)

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 10:40 am

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

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: PHP/ JS ->Show analog clock

Wed May 06, 2015 12:17 pm

This works. See attachment.

Somebody owes me 5 Euro :)
Attachments
clock.html.gz
(1.58 KiB) Downloaded 94 times
Memory in C++ is a leaky abstraction .

Return to “Other programming languages”