2017-10-12 5 views
0

ich an einem Projekt arbeite, und dies ist der entsprechende Code für das ProblemVerkettung von dynamischen integer mit id

function calldiv(c) 
{ 
    $("modal_dialog").dialog({ 
     title: "Approach with your deal", 
     buttons: { 
      Close: function() { 
       $(this).dialog('destroy') 
      } 
     }, 
     modal: true 
    }); 

} 

Hier ist, was ich will, ist Wert von c befestigen mit modal_dialog auf Laufzeit, dh wenn c = 1 dann wird die nächste Zeile modal_dialog1. Dank

+0

nächste Zeile bedeutet ??. Können Sie erklären, was Sie wollen –

+0

$ ("modal_dialog" + c) .dialog ({...})? – zfrisch

Antwort

0

Concat c mit der Zeichenfolge verwendet modal_dialog Ziel:

function calldiv(c) 
{ 
    $("modal_dialog"+c).dialog({ 
     title: "Approach with your deal", 
     buttons: { 
      Close: function() { 
       $(this).dialog('destroy') 
      } 
     }, 
     modal: true 
    }); 

}