我正在使用 Uploadify 上传图片。现在我需要获取正确的上传路径。
我有以下代码/脚本:
<?php
$uploadifyPath = get_bloginfo('url') . '/wp-content/plugins/uploadify/';
$galleryPath = "'".getGalleryURL('1620')."'"; // <--- 1620 is inputed by me.
?>
<input id="galleryID" type="hidden" value="1620" name="galleryID"/>
<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">// <![CDATA[
$(document).ready(function() {
$('#fileInput').uploadify({
'uploader' : '<?php echo $uploadifyPath ?>uploadify.swf',
'script' : '<?php echo $uploadifyPath ?>uploadify.php',
'cancelImg' : '<?php echo $uploadifyPath ?>cancel.png',
'auto' : true,
'folder' : <?php echo $galleryPath ?>
});
});
// ]]></script>
如何使用 jQuery 获取 galleryID 的值并将其输入到我的函数中getGalleryURL()
?
或者......有没有更好的方法来做到这一点?