Friday, July 25, 2014

GeoLocation in Opera (Win 8)

Testing the GeoLocation functionality in the Opera browser using my previous post http://nilslande.blogspot.no/2014/06/google-earth-part-2-where-are-you.html .

When I press the button to get my position Opera asks for my position with this dialog:



When I press allow I am also asked to accept Google's terms of service:



The fact that the web-page is using my position is shown with a little Location-symbol in left part of the address field:




If I press the Location-symbol I can clear the permission:



This is very similar to the functionality in  Chrome, as expected.

The settings for Geolocation is also quite good in Opera:



I especially like the Geolocation exceptions dialog where you can see all permissions that have been granted or refused:






Tuesday, July 8, 2014

Hello Post 7

My previous post had a static class. Lets see if we can use that class in this post.
The button below has 2 different behaviours:

  1. If my previous post (referred to as 'Post7') is visible the Post7.sayHello() function will be called and the message counter will be updated.
  2. If only this post is shown, then an alert message is shown and no message counter is incremented(since it does not exist).


The code:

Sunday, July 6, 2014

Static variables and methods (more JavaScript)

Another post for experimenting with JavaScript. This really started when I made my second Google Earth post and relized that my Google Earth object (named 'ge') was global. This caused a lot of strange behaviour when more than one blog-post was shown at the same time.

This post contains my soultion to this problem; I will put my variable and functions into an object for each post.


-- hello ? --



See also:
http://elegantcode.com/2011/01/19/basic-javascript-part-7-static-properties-and-methods/

The code:

Object Literal (JavaScript)

This is another one of my small JavaScrpt test posts. Since I am a novice in JavaScript and HTML this may not be that interseting for others.

This post is a small variation of my earlier Hello world post. This post uses an object literal that contains a single method. The method is called from two buttons, one directly and one indirectly using a onClick function.
The object and all globals (variable names, functions HTML element IDs) have a number appende to them to avoid naming clashes with my other posts.



See also:
http://en.wikipedia.org/wiki/Object_literal
http://en.wikipedia.org/wiki/Hello,_world

The code: