I have a php-file with a link in it. When pressing the link a jQuery alert popup shows up asking the user if he would like to proceed.
In the alert popup I want to be able to ask the user if he would like to proceed in different languages depending on what language he have chosed from the begining on my site.
So my code partially looks like this and some of the code is to explain how I think about it. example.php:
<?php
$lang = $this->lang->line('alert_message');
echo '<a href="file.php" class="link-alert">Accept</a>';
?>
functions.js:
$("a.link-alert").click(function(event){
var answer = confirm($lang);
if(answer){
// go to destination
return true;
}else{
// cancel
return false;
}
});
As seen above $lang is in the .php-file and I want to print it through an alert in functions.js. I preferably dont want to do inline js-code, though this would be messy.