Welcome Guest, Not a member yet? Register   Sign In
Performance Question: jQuery Modal Dialog
#4

[eluser]kingmaoam[/eluser]
So now I have this code:

Code:
<.script type="text/javascript">

$(document).ready(function() {

$('a.button_mini').click(function() {
    
var ID = $(this).attr("id");
var targetUrl = ' ';

switch(ID) {
&lt;? foreach($einsatz as $item) { ?&gt;
case "confirm_link_&lt;?=$item["einsatzID"]?&gt;": targetUrl = "&lt;?=base_url('admin/content/deleteEinsatz/'.$item['einsatzID'])?&gt;"; break;
&lt;? } ?&gt;
}

  $dialog.dialog('open');
  // prevent the default action, e.g., following a link
  return false;
});

var $dialog = $('<div></div>')
.html('Wollen Sie den Einsatz wirklich löschen?')
  .dialog({
   autoOpen: false,
   title: 'Einsatz löschen',
   width: '600px',
   modal: true,
   buttons: {
    "Löschen": function() {
             w.indow.l.ocation.href = targetUrl
    },
    "Zurück": function() {
     $( this ).dialog( "close" );
    }
   }
  });

});
</.script>

The a tag is as followed
Code:
<a id="confirm_link_&lt;?=$item['einsatzID']?&gt;" href="&lt;?=base_url('admin/content/deleteEinsatz/'.$item['einsatzID'])?&gt;" class="button_mini"><span class='button_delete_small'></span></a>
Rendered it is f.e. confirm_link_2062

On outputting ID via d.ocument.write it is confirm_link_2062 but my javascript console says targetUrl is not defined...



Messages In This Thread
Performance Question: jQuery Modal Dialog - by El Forum - 08-20-2012, 06:41 AM
Performance Question: jQuery Modal Dialog - by El Forum - 08-20-2012, 07:05 AM
Performance Question: jQuery Modal Dialog - by El Forum - 08-20-2012, 07:43 AM
Performance Question: jQuery Modal Dialog - by El Forum - 08-20-2012, 08:12 AM
Performance Question: jQuery Modal Dialog - by El Forum - 08-20-2012, 08:25 AM
Performance Question: jQuery Modal Dialog - by El Forum - 08-20-2012, 08:47 AM
Performance Question: jQuery Modal Dialog - by El Forum - 08-22-2012, 05:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB