Skip to main content
Inspiring
May 22, 2020
Question

variable einsetzen

  • May 22, 2020
  • 1 reply
  • 701 views

variable einsetzen funktioniert nicht

 

land_1_seite_1_bt_1

 

x = 1;//land
y = 1;//seite

this.land_1_seite_1_bt_1.on("click", anzeige_web_1_2);

this.["land_" + x +"_seite_" + x + "_bt_" + x].on("click", anzeige_web_1_1);

 

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 22, 2020

use:

 

this["your string"].on("click",etcF);

 

NOT

 

this.["your string"].on("click",etcF);

hds26846Author
Inspiring
May 23, 2020

danke es funktioniert

ich habe noch eine bitte.

("click", anzeige_web_1_1) klappt nicht.

danke vorab

 

//-------------------------------------------
//funktioniert

x = 1;//land
y = 1;//seite

this[["land_"+x]+["_seite_"+y]+"_bt_1"].on("click", anzeige_web_1_1);

function anzeige_web_1_1(evt) {

pop = window.open(...........................);  
	pop.focus();
}

//----------------------------------------------------------------------------------------
//funktioniert nicht

x = 1;//land
y = 1;//seite

this[["land_"+x]+["_seite_"+y]+"_bt_1"].on("click" , [anzeige_web_+[y]+_1]);


function [anzeige_web_+[y]+_1](evt) {

pop = window.open(...........................);  
	pop.focus();
}

 

 

kglad
Community Expert
Community Expert
May 23, 2020

use:

 

this["land_"+x+"_seite_"+y+"_bt_1"].on("click", anzeige_web_1_1)