Here is my scenario:
- I'm processing an excel file that'll took about ~10 minute
- While processing, I want to send a feedback to user that we are currently processing
My idea was using Session that will put value while processing, and get that Session using javascript in current view
Here's my script:
<script type="text/javascript">
$(document).ready(function() {
var element = document.getElementById("progress");
setInterval(
function(){
element.innerHTML = "{{Session::get('progress')}}";
},500
);
});
</script>
And somewhere in my controller, let's just say like this:
$i = 0;
while(!$done){
processingComplicated();
Session::put('progress', $i);
Session::save();
}
And my basic view :
<div id="progress">0</div>
Basically, I want the current page to get the Session data and update the view(id="progress"), but it won't change.
Can it be done? \
Thanks!!