# Accessing properties of class in javascript

**URL:** <https://forums.fusetools.com/t/accessing-properties-of-class-in-javascript/5912>\
**Category:** How-to Discussions\
**Created:** [May 31, 2017, 4:37pm UTC](https://forums.fusetools.com/t/accessing-properties-of-class-in-javascript/5912 "2017-05-31T16:37:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Giroux](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/marc_giroux/32/45_2.png) [@Marc\_Giroux](https://forums.fusetools.com/u/Marc_Giroux)\
**Post date:** [May 31, 2017, 4:37pm UTC](https://forums.fusetools.com/t/accessing-properties-of-class-in-javascript/5912/1 "2017-05-31T16:37:07Z")

</div>

I might be way out and don’t understand something but i’m trying to access the value of a property in javascript and i’m getting nowhere

Here is the Code in my class (the value of PoliciesURL is set when i instantiate the class)

```auto
<string ux:Global="PolicyURL" ux:Value="https://mysite.com/terms-and-conditions" />
<Landing ux:Template="landing" router="router" PoliciesURL="PolicyURL" />

```

```auto
<Page ux:Class="Landing" Color="Black">
    <object ux:Property="PoliciesURL" />
    <JavaScript File="src/Landing.js"/>
    <Text Clicked="{gotoPolicies}">Terms of Use</Text>

```

Showing in UX works perfectly, but javascript, not so much.

This is what i’m doing in my javascript

```auto
function gotoPolicies() 
{     
    console.log(this.PoliciesURL);
}

module.exports = { gotoPolicies };

```

When i click i always get “null”. I’ve read many threads that show stuff like this and it works for them. What am i doing wrong?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [May 31, 2017, 4:44pm UTC](https://forums.fusetools.com/t/accessing-properties-of-class-in-javascript/5912/2 "2017-05-31T16:44:09Z")

</div>

Hi Marc,

the properties are _reactive Observables_. So it looks like you’re using it wrong.

We just discussed the same thing in [this thread](https://www.fusetools.com/community/forums/howto_discussions/passing_observables_through_properties_uxproperty?page=1&highlight=16c14c24-46f0-4be3-a0e1-0b6b3e025161#post-16c14c24-46f0-4be3-a0e1-0b6b3e025161). Take a look there and see if that helps!

---

<div class="post-metadata">

**Author:** ![Marc\_Giroux](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/marc_giroux/32/45_2.png) [@Marc\_Giroux](https://forums.fusetools.com/u/Marc_Giroux)\
**Post date:** [May 31, 2017, 5:35pm UTC](https://forums.fusetools.com/t/accessing-properties-of-class-in-javascript/5912/3 "2017-05-31T17:35:54Z")

</div>

Hi Uldis,

Yeah that helped understand how it works. It’s kinda jarring way to work with objects/variables but works in the end.

Thanks
