Welcome Guest, Not a member yet? Register   Sign In
Flashdata with Sweetalert2
#1

Hi All,


I have problem when I try to combine flashdata with Sweetalert2,

Controller :
PHP Code:
public function social_settings_pro() 
    {
        
$disable_social_login 
            
intval($this->input->post("disable_social_login"));
        
$twitter_consumer_key 
            
$this->common->nohtml($this->input->post("twitter_consumer_key"));
        
$twitter_consumer_secret 
            
$this->common->nohtml($this->input->post("twitter_consumer_secret"));
        
$facebook_app_id 
            
$this->common->nohtml($this->input->post("facebook_app_id"));
        
$facebook_app_secret 
            
$this->common->nohtml($this->input->post("facebook_app_secret"));
        
$google_client_id 
            
$this->common->nohtml($this->input->post("google_client_id"));
        
$google_client_secret 
            
$this->common->nohtml($this->input->post("google_client_secret"));

        
$this->admin_model->updateSettings(
            array(
                
"disable_social_login" => $disable_social_login,
                
"twitter_consumer_key" => $twitter_consumer_key,
                
"twitter_consumer_secret" => $twitter_consumer_secret,
                
"facebook_app_id" => $facebook_app_id
                
"facebook_app_secret"=> $facebook_app_secret 
                
"google_client_id" => $google_client_id,
                
"google_client_secret" => $google_client_secret,
            )
        );
        
$this->session->set_flashdata("globalmsg"lang("success_13"));
        
redirect(site_url("admin/social_settings"));
    } 


View :
PHP Code:
<?php if ($this->session->flashdata('globalmsg')): ?>
<script type="text/javascript">
  $(document).ready(function() {
  swal({
  title: "Done",
  text: "<?php echo $this->session->flashdata('globalmsg'); ?>",
  timer: 1500,
  showConfirmButton: false,
  type: 'success'
  });
  });
</script>
<?php endif; ?>


I get error like below,
Code:
Uncaught TypeError: Cannot read property 'querySelector' of null
Reply


Messages In This Thread
Flashdata with Sweetalert2 - by googlemy - 09-03-2017, 12:26 PM
RE: Flashdata with Sweetalert2 - by php_rocs - 09-04-2017, 07:02 AM
RE: Flashdata with Sweetalert2 - by Waschi - 09-04-2017, 07:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB