How to pass javascript variable to a PHP file in Laravel 5.1? -
i need know need passing javascript variable php file.
all have done till created form inputs values alongside have javascript variable need pass same location of form.
so how achieve in laravel 5.1?
try jquery ajax method, in can pass js variable , use in php on other server side scripting language.
syntax:
$.ajax({ url: 'process.php', method: 'post', data: { variable1 : value1, // can use these variable in process.php file variable2 : value2 }, success: function(response) { } });
Comments
Post a Comment