Include global variable into action execute javascript?

Get help using Construct 2

Post » Fri Aug 11, 2017 3:06 pm

Do I have anyway to sneak in a global variable into 'browser execute javascript' action?
Some thing like, for example

var ref = cordova.InAppBrowser.open('http://===INSERT VARIABLE HERE===', '_blank', 'location=yes');
B
14
S
2
Posts: 31
Reputation: 724

Post » Fri Aug 11, 2017 6:14 pm

try:
Global variable c2Var = "https://www.scirra.com/"

Code: Select all
"var myUrl ='"&c2Var&"';
var ref = cordova.InAppBrowser.open( myUrl, '_blank', 'location=yes');"
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sat Aug 12, 2017 6:28 pm

korbaach wrote:try:
Global variable c2Var = "https://www.scirra.com/"

Code: Select all
"var myUrl ='"&c2Var&"';
var ref = cordova.InAppBrowser.open( myUrl, '_blank', 'location=yes');"


Thank you. I'll try it out. :D
B
14
S
2
Posts: 31
Reputation: 724


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Pulstar and 12 guests