HTML5 手机页面 输入表单被键盘遮挡住了
HTML5 手机页面 输入表单被键盘遮挡住了请问 大神 怎么 js 或者 JQ 判断安卓手机软键盘的键盘隐藏键按下去了?有使用 uexWindow 方法 能判断到确定键 是 13 但是不知道这个键的键值 是什么?或者有什么其他方法? 判断窗口尺寸改变的 size 方法无效l
html5新增的标签aside具体是什么啊?
html5新增的标签aside具体是什么啊?
HTML5中对地理定位的理解是什么?支持什么类型的浏览器呢?
HTML5中对地理定位的理解是什么?支持什么类型的浏览器呢?
HTML5中的<video>标签描述了什么?
HTML5中的
标签描述了什么?
html5标签语义化 (section article)到底该如何应用
到底该应用到什么地方
到底该应用的生地方
研究了一下 主要用于 页面上的版块 用于划分页面上的不同区域,或者划分文章里不同的节
article > 用来在页面中表示一套结构完整且独立的内容部分 可以用来呈现论坛的一个帖子,杂志或报纸中的一篇文章,一篇博客,用户提交的评论内容,可互动的页面模块挂件等。
免插件实现 WP 的百度熊掌号结构化改造
前言
十月底的时候百度站长平台突然就改版了,毕竟没有参与过内测的小网站主看到这个有点懵逼,然后看了一下原创保护引入到了熊掌号,也就是之前的官方号。
简单看了一下,熊掌号同 MIP 相比门槛更低只要是 HTML5 + HTTPS 就可以兼容,那么大的好事怎么能不凑凑热闹呢!
介绍
熊掌号为百度搜索新产品,其前身是百度官方号,百度熊掌号是站长、自媒体、开发者、商家等各种内容和服务提供者入驻百度的身份账号,该账号可实现包括百度搜索资源平台、百度数据开放平台、百家号自媒体平台、用户运营平台等各类平台的能力互通。
目前阿里云大鱼号、头条号、公众号这样的自媒体(新媒体)持续发展势头不小,可以说已经是掌握了移动内容类流量的入口,百度在移动领域越发被动,要知道 UC 浏览器的默认搜索引擎都是他们家的神马搜索,百度的移动流量越来越少。
因此百度重整旗鼓后,推出的新的移动战略将百家号、站长平台等合并肯定会放出非常多的利好来进行宣传,这样非常有利于站长的优质内容被收录和浏览。
WP引入
那么 WordPress 如何快速改造支持 熊掌号 的结构化引入呢?这里米饭就教大家一个不用插件的好方法虽然麻烦了点,但是插件用多了网站真的会很慢!其实 熊掌号 的结构化引入和之前的星火计划差不多,所以有了相关改造基础就很容易了。
因为在 WordPress 2.9 发布之后,WordPress 就已经默认支持 Canonical 标签了,所以我我们不需要修改 header.php 文件。
结构化改造
结构化数据和其他重点就是例如米饭的这一段:
其实也简单,修改所用主题的 footer.php 文件:
只要将 你的 APPID 修改为你的 APPID 就 ok 了!然后我们图片引用的是 WP 中的特色图片。
然后我们在检验一下就行!
API提交内容
改造好 WP 后还是不够的,百度的要求是还需要将内容推送过去,支持 API 和 手动提交两种姿势,这个站长平台的链接提交的方法一致。
手段推送是不可能的,这辈子都被不会手动推送。那么我们就来一段 function 自动推送就行!
在主题的 function.php 中加入:
/*** WordPress API 方式自动推送到百度熊掌号* 文章地址:https://www.mf8.biz/wp-xiongzhang-baidu/*/if(!function_exists('Baidu_XZH_Submit')){ function Baidu_XZH_Submit($post_ID) { //已成功推送的文章不再推送 if(get_post_meta($post_ID,'BaiduXZHsubmit',true) == 1) return; $url = get_permalink($post_ID); $api = 'http://data.zz.baidu.com/urls?appid=你的APPID&token=你的TOKEN&type=realtime'; $request = new WP_Http; $result = $request->request( $api , array( 'method' => 'POST', 'body' => $url , 'headers' => 'Content-Type: text/plain') ); $result = json_decode($result['body'],true); //如果推送成功则在文章新增自定义栏目BaiduXZHsubmit,值为1 if (array_key_exists('success',$result)) { add_post_meta($post_ID, 'BaiduXZHsubmit', 1, true); } } add_action('publish_post', 'Baidu_XZH_Submit', 0);}
这样我们就完成了 WordPress 的熊掌号结构性改造了,基本上支持所有 WP 主题不存在兼容性问题,如果有问题请及时反馈给米饭!
java 连接云redis 报 Unable to configure Redis to keyspace notifications.
2016.09.02 10:28:21.305 [localhost-startStop-1] ERROR [org.springframework.web.context.ContextLoader.initWebApplicationContext:351] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Unable to configure Redis to keyspace notifications. See http://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisoperationssessionrepository-sessiondestroyedeventat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842) [catalina.jar:8.0.36]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) [catalina.jar:8.0.36]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [catalina.jar:8.0.36]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) [catalina.jar:8.0.36]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) [catalina.jar:8.0.36]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) [catalina.jar:8.0.36]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940) [catalina.jar:8.0.36]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816) [catalina.jar:8.0.36]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_91]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_91]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]Caused by: java.lang.IllegalStateException: Unable to configure Redis to keyspace notifications. See http://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisoperationssessionrepository-sessiondestroyedeventat org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.getNotifyOptions(ConfigureNotifyKeyspaceEventsAction.java:81) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.configure(ConfigureNotifyKeyspaceEventsAction.java:55) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration$EnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:224) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 25 moreCaused by: org.springframework.dao.InvalidDataAccessApiUsageException: ERR unknown command config; nested exception is redis.clients.jedis.exceptions.JedisDataException: ERR unknown command configat org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:64) ~[spring-data-redis-1.7.1.RELEASE.jar:?]
at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:41) ~[spring-data-redis-1.7.1.RELEASE.jar:?]
at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.7.1.RELEASE.jar:?]
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.7.1.RELEASE.jar:?]
at org.springframework.data.redis.connection.jedis.JedisConnection.convertJedisAccessException(JedisConnection.java:212) ~[spring-data-redis-1.7.1.RELEASE.jar:?]
at org.springframework.data.redis.connection.jedis.JedisConnection.getConfig(JedisConnection.java:573) ~[spring-data-redis-1.7.1.RELEASE.jar:?]
at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.getNotifyOptions(ConfigureNotifyKeyspaceEventsAction.java:74) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.configure(ConfigureNotifyKeyspaceEventsAction.java:55) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration$EnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:224) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 25 moreCaused by: redis.clients.jedis.exceptions.JedisDataException: ERR unknown command configat redis.clients.jedis.Protocol.processError(Protocol.java:117) ~[jedis-2.8.1.jar:?]
at redis.clients.jedis.Protocol.process(Protocol.java:151) ~[jedis-2.8.1.jar:?]
at redis.clients.jedis.Protocol.read(Protocol.java:205) ~[jedis-2.8.1.jar:?]
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297) ~[jedis-2.8.1.jar:?]
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:233) ~[jedis-2.8.1.jar:?]
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:226) ~[jedis-2.8.1.jar:?]
at redis.clients.jedis.Jedis.configGet(Jedis.java:2578) ~[jedis-2.8.1.jar:?]
at org.springframework.data.redis.connection.jedis.JedisConnection.getConfig(JedisConnection.java:571) ~[spring-data-redis-1.7.1.RELEASE.jar:?]
at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.getNotifyOptions(ConfigureNotifyKeyspaceEventsAction.java:74) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.configure(ConfigureNotifyKeyspaceEventsAction.java:55) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration$EnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:224) ~[spring-session-1.2.0.RELEASE.jar:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 25 more
关于html5能代替IOS和安卓上的原生程序吗?
html5能代替IOS和安卓上的原生程序吗? 看网上很多人讨论这个?
svg跟canvas如何分工?
HTML5同时支持svg跟canvas其实很多时候,效果是一样的,用途是一样的这两者,一般如何分工?
HTML5里的datelist标签可以传递Name和Value吗?
就像Select Option标签,在Option里显示名字,实际上是传递名字对应的Id(主键)DateList可以实现这种效果吗?