Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- How to pass php variable to jquery javascript


chrissim - 10:20 am on Mar 20, 2012 (gmt 0)


i have this config.php update and write new variable $uploaddir everytime i create new folder and i need to pass those variable 'new upload folder' to jquery javascript href below.
Please help as i been pulling my hair for several days now...



<?php

$uploaddir = '../folder/newfolder/';

?>




.bind('uploadSuccess', function(event, file, serverData){
var item=$('#log li#'+file.id);
item.find('div.progress').css('width', '100%');
item.find('span.progressvalue').text('100%');
var pathtofile='<a href="../$uploaddir/'+file.name+'" target="_blank" >view upload file &raquo;</a>';
item.addClass('success').find('p.status').html('Done! | '+pathtofile);
})


Thread source:: http://www.webmasterworld.com/javascript/4431212.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com