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
10
S
2
Posts: 17
Reputation: 589

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');"
Image
B
63
S
23
G
7
Posts: 1,479
Reputation: 10,784

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
10
S
2
Posts: 17
Reputation: 589


Return to How do I....?

Who is online

Users browsing this forum: BadMario, istero, mr32D, mtnboy22, user5487 and 1 guest