Skip to content

Commit 7a3ac50

Browse files
authored
Merge pull request #1139 from PaulCapron/master
Improve minor things in scripting-docs/jswinrt/handling-windows-runtime-events-in-javascript.md
2 parents 4a3d69c + 6b73c84 commit 7a3ac50

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripting-docs/jswinrt/handling-windows-runtime-events-in-javascript.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ ms.author: "mikejo"
1919
manager: "ghogen"
2020
---
2121
# Handling Windows Runtime Events in JavaScript
22-
Windows Runtime events are not represented in the same way in JavaScript as they are in C++ or the .NET Framework. They are not class properties, but rather are represented as string identifiers that are passed to the class's `addEventListener` and `removeEventListener` methods. For example, you can add an event handler for the [Geolocator.PositionChanged](http://msdn.microsoft.com/library/windows/apps/xaml/windows.devices.geolocation.geolocator.positionchanged.aspx) event by passing the string "positionchanged" to the `Geolocator.addEventListener` method:
22+
Windows Runtime events are not represented in the same way in JavaScript as they are in C++ or the .NET Framework. They are not class properties, but rather are represented as (lowercased) string identifiers that are passed to the class's `addEventListener` and `removeEventListener` methods. For example, you can add an event handler for the [Geolocator.PositionChanged](https://msdn.microsoft.com/library/windows/apps/xaml/windows.devices.geolocation.geolocator.positionchanged.aspx) event by passing the string "positionchanged" to the `Geolocator.addEventListener` method:
2323

2424
```JavaScript
25-
var locator = new Windows.Devices.Geolocation.Geolocator();
25+
var locator = new Windows.Devices.Geolocation.Geolocator();
2626
locator.addEventListener(
2727
"positionchanged",
2828
function (ev) {
2929
console.log("Got event");
3030
});
3131
```
3232

33-
You can also set the `locator.onpositionchanged` property.
33+
You can also set the `locator.onpositionchanged` property:
3434

35-
```
35+
```JavaScript
3636
locator.onpositionchanged =
3737
function (ev) {
3838
console.log("Got event");

0 commit comments

Comments
 (0)