Reputation: 327
here i have variable fileVal takes path of file like uploads/import/abc.pdf
var fileVal = $('#fileimport').val();
here fileVal takes path of file like uploads/import/abc.pdf
i have to send this file path as url variable to a php file and then display result on messagediv. like
$('#messagediv').load('../xyz.php?file='+fileVal);
here without url variable, its working perfect getting values to the messagediv.
But where as using url variable its not.
How i can solve this?
Upvotes: 2
Views: 562
Reputation: 17566
try with encodeURIComponent()
var fileVal = encodeURIComponent($('#fileimport').val());
Upvotes: 1
Reputation: 28409
That should work fine except you have a syntax error
// $var fileVal = $('#fileimport').val();
var fileVal = $('#fileimport').val();
Upvotes: 0