我有一个由jQuery/JS填充的输入.目前它使用这样的日期值填充输入,2017-3-7
但我希望它是2017-03-07
.
我在这里有一个jsfiddle:https://jsfiddle.net/ua8rngzw/
代码如下:
(function ($) {
$(document).ready(function() {
var now = new Date();
var created = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate();
$('#created').val(created);
});
})(jQuery);
Run Code Online (Sandbox Code Playgroud)
做这种事最简单快捷的方法是什么?
我想将一个文件完全包含在变量中.这样我就可以多次调用这个var并保持代码尽可能干净.但是当我回显var时它只返回一个1
,当我使用include
on本身时它会输出整个文件.
我想输出包含的文件并运行其中的所有PHP代码.
那么我在这里做错了什么.
$jpath_eyecatcher = (JURI::base(). "modules/mod_eyecatcher/tmpl/content/eyecatcher.php");
$jpath_eyecatcher_path = parse_url($jpath_eyecatcher, PHP_URL_PATH);
ob_start();
$eyecatcher = include ($_SERVER['DOCUMENT_ROOT'] . $jpath_eyecatcher_path);
ob_end_clean();
echo $eyecatcher . '<br>';
include ($_SERVER['DOCUMENT_ROOT'] . $jpath_eyecatcher_path);
Run Code Online (Sandbox Code Playgroud)
1
eyecatchertype = 2
fontawesome
envelope-o
insert_emoticon
custom-icon-class
128
images/clientimages/research (1).jpg
top
test
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助!