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');
Image
B
24
S
7
G
2
Posts: 53
Reputation: 2,572

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,519
Reputation: 11,104

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
Image
B
24
S
7
G
2
Posts: 53
Reputation: 2,572


Return to How do I....?

Who is online

Users browsing this forum: dznerpro, ultrafop and 3 guests