ofey
Posts: 152
Joined: Tue Jul 16, 2013 9:41 pm
Location: St.Gallen, Switzerland/Dublin, Ireland
Contact: Website

Epiphany Javascript console.log()

Sat Jan 24, 2015 11:41 am

Hi,
I am learning a little javascript and using Epiphany as the browser on a RPi.
In the book i am using, 'Eloquent Javascript', most examples output with console.log() but I can't see how to see this output in Epiphany.
Is there no console output in Epiphany?
Any ideas?
Thanks,
Shane
Pi = too much fun!

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 11:56 am

>> Is there no console output in Epiphany?

perhaps not you can allwats create the console object and create a log() function in it ...

or create a div and push the log content to that ...

Sorry cant be much help .
Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

ofey
Posts: 152
Joined: Tue Jul 16, 2013 9:41 pm
Location: St.Gallen, Switzerland/Dublin, Ireland
Contact: Website

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 12:08 pm

r3d4 wrote:create the console object and create a log() function in it ... or create a div and push the log content to that ...
Thanks for your reply. Objects are the next chapter, so this is a little beyond me at the moment.
Should try a different browser?
Thanks,
Shane
Pi = too much fun!

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 1:08 pm

ofey wrote:
r3d4 wrote:create the console object and create a log() function in it ... or create a div and push the log content to that ...
Thanks for your reply. Objects are the next chapter, so this is a little beyond me at the moment.
Should try a different browser?
Thanks,
Shane
Well im no expert ;) (and i dont have Epiphany on a pi to hand ... perhaps it has so other way of looking at logs/errors ?? )
but i would just skip a head a chaper to read up on objects and or use this

Code: Select all


var console = {} ; // <---- This is an object called console 

console.log = function (str) { alert( str ) ; }  
// -----
// you can write the above in a diffrent way like 

var console = { "log" : function (str){ alert(str) ;  }     } ; 

Json.org has some good diagrams of the object notation used en JS .


>> Should try a different browser?
Realy it is up to you , when i was learning js console.log() was not avalable as a 'built in function' of the browser
so you can survive without it if need be , one alternative method would be to just use

Code: Select all

 alert('somthing happened') ;  
Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

User avatar
DougieLawson
Posts: 36177
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 5:24 pm

ofey wrote: Should try a different browser?
Firefox with the web developer (on Windows) stuff is going to be much better.

Develop & debug on Windows, deploy on Raspberry Pi.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ofey
Posts: 152
Joined: Tue Jul 16, 2013 9:41 pm
Location: St.Gallen, Switzerland/Dublin, Ireland
Contact: Website

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 6:18 pm

Hi,
r3d4 thanks i will just use alert() for the moment.
json.org does have very clear diagrams. Thanks for this.
Develop & debug on Windows, deploy on Raspberry Pi.
Thanks Dougie, I think this the best option.
Shane
Pi = too much fun!

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 8:11 pm

DougieLawson wrote: Firefox with the web developer (on Windows) stuff is going to be much better.

Develop & debug on Windows, deploy on Raspberry Pi.

Code: Select all

\r\n
Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

ofey
Posts: 152
Joined: Tue Jul 16, 2013 9:41 pm
Location: St.Gallen, Switzerland/Dublin, Ireland
Contact: Website

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 10:33 pm

\r\n
and this means it is all the same?
Like carriage return / newline... probably a techie joke... :?:
Pi = too much fun!

User avatar
DougieLawson
Posts: 36177
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Epiphany Javascript console.log()

Sat Jan 24, 2015 11:29 pm

r3d4 wrote:

Code: Select all

\r\n
I'll see your carriage return & newline and raise you

Code: Select all

+.;
I assume it's some kind of poker bidding, because it doesn't make any sense otherwise.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ofey
Posts: 152
Joined: Tue Jul 16, 2013 9:41 pm
Location: St.Gallen, Switzerland/Dublin, Ireland
Contact: Website

Re: Epiphany Javascript console.log()

Sun Jan 25, 2015 3:12 pm

DougieLawson wrote:...some kind of poker bidding, ... it doesn't make any sense otherwise.
Glad to hear that!
Pi = too much fun!

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Epiphany Javascript console.log()

Mon Jan 26, 2015 9:38 am

DougieLawson wrote:
r3d4 wrote:

Code: Select all

\r\n
I'll see your carriage return & newline and raise you

Code: Select all

+.;
I assume it's some kind of poker bidding, because it doesn't make any sense otherwise.
:lol:
Its the first thing i can remember about working between windows n other os that wiill trip up any one using default text editors ; that dont display chars you cant see .
Perhaps this is no longer a problem ??

i did not see the OP didnt mention windows ..
>> 'Develop & debug on Windows, deploy on Raspberry Pi.'

to me apperars like pointing some asking for directions the wrongway :?
Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

User avatar
DougieLawson
Posts: 36177
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Epiphany Javascript console.log()

Mon Jan 26, 2015 11:33 am

The newline vs carriage return/newline is not a problem with Javascript.

If it ever is a problem then dos2unix is the simple tool to undo the \r\n stuff.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

jweob
Posts: 31
Joined: Sun Jul 15, 2012 1:56 pm

Re: Epiphany Javascript console.log()

Sun Jul 19, 2015 9:09 pm

I'm launching epiphany from the command line using SSH using "epiphany-browser -a --profile ~/.config <URL>"

console.log() messages appear in the SSH terminal output

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Epiphany Javascript console.log()

Wed Jul 22, 2015 4:01 pm

DougieLawson wrote:If it ever is a problem then dos2unix is the simple tool to undo the \r\n stuff.
True but i would guess that the 'command line' tools ect is a bit further along the 'learning curve' for most who wander in off the web scripting js !

gadgetoid
Posts: 152
Joined: Wed Mar 07, 2012 9:58 pm

Re: Epiphany Javascript console.log()

Wed Mar 16, 2016 2:17 pm

I hate to resurrect a dinosaur thread, but in this case I think it's warranted.

This thread turns up in searches about how to enable the JS debugger, so for the help of future JS tinkerers, I'd like to supply the answer:

Open up Terminal, and run Epiphany like so:

Code: Select all

EPHY_ENABLE_INSPECTOR=true epiphany
Developing and debugging on Windows/Chrome is not always the right answer, since you can very easily fall into traps set by ECMA Script 6 only features which are not supported in Epiphany. IE: Something can work absolutely *fine* on Windows/Chrome but fail in Epiphany 3.8.x on the Pi.

The magic words above will give you a clunky albeit functional debugger for catching any incompatibilities which slip through.

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Epiphany Javascript console.log()

Thu Apr 14, 2016 1:20 pm

gadgetoid wrote:

Code: Select all

EPHY_ENABLE_INSPECTOR=true epiphany
The magic words above will give you a clunky albeit functional debugger for catching any incompatibilities which slip through.
Thanks!
(from a current tinkerer)

Return to “Troubleshooting”