js利用cookies与正则设置字体高亮显示
<script type="text/网页特效" language="javascript">
var c_saved = new cookie("regex_pattern_colorize", "/");
var b_colorized = ! (c_saved.value == "false");function colorize()
{
if( b_colorized )
{
if( regex_pattern_colorize_all( "pattern" ) )
change_links( "swtch", "关闭高亮", "采用同一种颜色显示表达式" );
else
show_tags( "swtch", false );
}
else
{
un_colorize_all( "pattern" );
change_links( "swtch", "高亮显示", "采用不同颜色显示表达式中的各个成分" );
}c_saved.value = b_colorized ? "true" : "false";
c_saved.save( 30 );b_colorized = ! b_colorized;
}colorize();
</script>
时间: 2024-10-25 02:02:50