JavaScript function question <Fixed>

For developers using the Construct 2 Javascript SDK

Post » Sun Jan 18, 2015 9:01 am

Javascript and I don't get along for some reason. :roll:
I made a small html file where I added two buttons "Read Text" and "Change Text".
In my Javascript file I added one variable text of value "Hello There!" and two functions. the first one output the text variable in the console log and alert it. The next button change the value of the text to "Welcome To Javascript!"

I ran the html file and clicked the button to read the text. It read the value perfectly. Then I changed the value and repressed the button. The value didn't change. From the log I saw that the script was reseeting whenever I call a function. Why is this happening? How can I keep the script running during the html file is open?
Last edited by Naji on Sun Jan 18, 2015 6:47 pm, edited 1 time in total.
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,446

Post » Sun Jan 18, 2015 3:20 pm

What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Sun Jan 18, 2015 6:46 pm

Never mind it is fixed now! :D I forget to add type to the button :lol:
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,446


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest