var user = navigator.userAgent;
var browser = {};
browser.opera = user.indexOf("Opera") > -1 && typeof window.opera == "object";
browser.khtml = (user.indexOf("KHTML") > -1 || user.indexOf("AppleWebKit") > -1 || user.indexOf("Konqueror") > -1) && !browser.opera;
browser.ie = user.indexOf("MSIE") > -1 && !browser.opera;
browser.gecko = user.indexOf("Gecko") > -1 && !browser.khtml;
if ( browser.ie ) {
var ie_reg = /MSIE (\d+\.\d+);/;
ie_reg.test(user);
var v = parseFloat(RegExp["$1"]);
browser.ie55 = v <= 5.5;
browser.ie6 = v <= 6;
}
Run Code Online (Sandbox Code Playgroud)
最近,我倾向于使用JavaScript.我看到一些代码来检查浏览器,但我不能很好地遵循它.代码对我来说太难了.可以向我解释一下吗?非常感谢.
INSERT INTO `configuration` VALUES ('', 'News Box Character Count', 'NEWS_BOX_CHAR_COUNT', '200', 'Set the number of characters (bytes) that you want to display in the news preview box.', 19, 99, NULL, '2004-09-07 12:00:00', NULL, NULL);
Run Code Online (Sandbox Code Playgroud)
我在phpMyAdmin中运行此命令,它显示
#1366 - Incorrect integer value: '' for column 'configuration_id' at row 1
Run Code Online (Sandbox Code Playgroud)
configuration_id 是一个自动增量字段,从1开始
info文件是对的,以下是我的模块文件代码.当我访问http:// localhost/drupal/mymenu 为什么它无法工作.
<?php
function mymenu(){
$item = array();
$item['mymenu'] = array(
'description'=>'test1',
'page callback'=>'mymenu_test',
'access arguments' => array('access mymenu'),
'type'=>MENU_CALLBACK,
);
return $item;
}
function mymenu_perm(){
return array('access mymenu');
}
function mymenu_test() {
$output = 'hello world';
return $output;
}
Run Code Online (Sandbox Code Playgroud)
我给了匿名者"访问mymenu"的许可.
现在,我想在内容类型故事中添加一个死区时间字段(样式为02-12-2010).怎么做,我使用了hook_form_alter()和format_date(),但是当我创建一篇新文章,然后选择时间.但是时间不能显示在文章的页面上.为什么?
我在网站上做了这样一个风格:
* {
font-family:Arial,Helvetica,sans-serif;
font-size:14px;
margin:0;padding:0;
}
Run Code Online (Sandbox Code Playgroud)
如何让主题在IE和Firefox下显示相同的风格?
preg_match( '/<title>(.*)<\/title>/',.....)
preg_match("/src=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i",....)