Archive for June, 2008
解决javascript无法使用submit方法提交表单问题
之前在使用javascript处理一个form的时候,发现无法使用submit方法来提交表单,firebug提示方法submit不存在.最后发现,form中提交的input设定了name=”submit”的属性,删除后问题解决.
由于input的name属性存在,导致document.form.submit被错误定位到input元素上,造成错误.
Wordpress 指定某个分类的文章到首页显示
// Get the last 10 posts in the special_cat category.
<?php query_posts('category_name=special_cat&showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Do special_cat stuff... -->
<?php endwhile;?>
注意,category_name要对应后台中Category Slug中的内容,而非Category Name.
Recent Comments
- sub040 on 原来我还年轻
- sub040 on 小孩…
- FT on 解决javascript无法使用submit方法提交表单问题
- sub040 on 考试
- sub040 on 无题
