bortz
1 month ago

JS @section not being loaded from mobile

Posted 1 month ago by bortz

Hello there! I'm having a problem with a Blade template. I have a template one.blade.php, which is something like:

@extends('layouts.adminlte.adminlte')

@section('title')
    My Title 1
@endsection

@section('content')
    @include('two')
@endsection

@section('js')
	<script>
		function checkTableValues() {
			...
		}
		
		function refreshTable(html) {
			...
		}

		...
		
		$(document).ready(function() {
			$(document).on('change','#myTextbox', function () {
                		data = JSON.stringify(myData());
                		$.ajax({
                    			url: '/get_table',
                    			type: 'get',
                    			data: {data: data},
                    			headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
                    			success: function(updated_html){
                        			refreshTable(updated_html);
                        			checkTableValues();
                    			}
                		});
            		});
		});
	</script>
@endsection

@section('css')
	...
@endsection

Then I have two.blade.php which is just returning a .

Now, when I go on https://localhost/one, it loads the view one.blade.php, which, in turn, includes the template two.blade.php (@include('two')) and then, whenever myTextbox gets changed, it retrieves the updated table with the above js form https://localhost/get_table/ (which gets handled by two.blade.php).

The problem is that from desktop everything runs fine, no errors at all. From mobile, the js inside the @section doesn't get loaded and thus it cannot retrieve the updated table from the other page. I don't know what the problem might be and I cannot even debug it from mobile because I'm on iOS and it seems pretty much impossible without having a Mac. Can someone, please, point me to the right direction?

Please sign in or create an account to participate in this conversation.