Welcome Guest, Not a member yet? Register   Sign In
alert msg box doesn't work.
#1

[eluser]hrg.vincent[/eluser]
Can anyone tell me how come alert doesn't work in controller. First I click on button then will call ajax and from ajax call controller. Anything missing from AJAX?
Code:
// Ajax
function loadSaveReportFn()
{
$.ajax({
  type: "GET",
  url: '<?php echo site_url('ajax/getSaveReport'); ?>/',
  
  success: function(r){
   handleErrorFn(r);  
  }  
});
}

Code:
// Controller
public function getSaveReport()
{
echo "< script > alert('test for echo');</ script >";
}
#2

[eluser]noideawhattotypehere[/eluser]
Whats the response from the server after calling your ajax function? (firebug is your best friend when debugging js)
#3

[eluser]hrg.vincent[/eluser]
[quote author="noideawhattotypehere" date="1385455818"]Whats the response from the server after calling your ajax function? (firebug is your best friend when debugging js)[/quote]

No response from server. if i add "$("#rp-holder").html®;". The alert is working but it will link to a blank content page.
Code:
function loadSaveReportFn()
{
$.ajax({
  type: "GET",
  url: '<?php echo site_url('ajax/getSaveReport'); ?>/',
  
  success: function(r){
   handleErrorFn(r);
   // ### add below ###
   $("#rp-holder").html(r);  
  }  
});
}




Theme © iAndrew 2016 - Forum software by © MyBB