<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>前端之路 &#187; height</title>
	<atom:link href="http://www.simcn.com/tag/height/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simcn.com</link>
	<description>网站开发, 前端开发, 高性能前端开发</description>
	<lastBuildDate>Thu, 03 Nov 2011 02:08:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>用PHP生成MYSQL数据字典</title>
		<link>http://www.simcn.com/dict-tools</link>
		<comments>http://www.simcn.com/dict-tools#comments</comments>
		<pubDate>Sat, 12 Feb 2011 02:09:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[Author Mark]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[Set Server]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.simcn.com/?p=380</guid>
		<description><![CDATA[写文档什么是最麻烦的事情. 能交给程序做就让程序做吧. 于是有了这个生成程序 PHP代码 /* Name: 生成mysql数据字典 URI: http://www.simcn.com/dict-tools Version: 1.0 Author: Mark.Chen Author URI: http://www.simcn.com */ //Set Server $dbserver="localhost"; $dbusername="root"; $dbpassword="max197997"; //接收get参数 if($_GET['db']==''){ $database = 'oms'; }else{ $database = $_GET['db']; } $mysql_conn=@mysql_connect("$dbserver","$dbusername","$dbpassword") or die("Mysql connect is error."); mysql_select_db($database,$mysql_conn); $result = mysql_list_tables($database,$mysql_conn); mysql_query('SET NAMES utf8',$mysql_conn); while ($tableList = mysql_fetch_array($result)){ $table = $tableList[0]; $field_result= mysql_query("SELECT * [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.simcn.com/dict-tools/db" rel="attachment wp-att-386"><img src="http://www.simcn.com/wp-content/uploads/2011/02/db.png" alt="" title="dict" width="692" height="235" class="alignnone size-full wp-image-386" /></a></p>
<p>写文档什么是最麻烦的事情. 能交给程序做就让程序做吧. 于是有了这个生成程序</p>
<p>PHP代码</p>
<pre name="code" class="brush:php">
/*
Name: 生成mysql数据字典
URI: http://www.simcn.com/dict-tools
Version: 1.0
Author: Mark.Chen
Author URI: http://www.simcn.com
*/

//Set Server
$dbserver="localhost";
$dbusername="root";
$dbpassword="max197997";

//接收get参数
if($_GET['db']==''){
    $database = 'oms';
}else{
    $database = $_GET['db'];
}

$mysql_conn=@mysql_connect("$dbserver","$dbusername","$dbpassword") or die("Mysql connect is error.");

mysql_select_db($database,$mysql_conn);
$result = mysql_list_tables($database,$mysql_conn);
mysql_query('SET NAMES utf8',$mysql_conn);
while ($tableList = mysql_fetch_array($result)){
    $table = $tableList[0];
    $field_result= mysql_query("SELECT * FROM
                               INFORMATION_SCHEMA.COLUMNS
                               WHERE
                               table_name = '$table' AND table_schema = '$database'",$mysql_conn
                                );

    echo '
<table>'.chr(13);
    echo '
<caption>'.$table.'</caption>

'.chr(13);
    echo '
<tr>
<th>字段名</th>
<th>数据类型</th>
<th>默认值</th>
<th>字符编码</th>
<th>备注</th>
</tr>

'.chr(13);
    while ($f = mysql_fetch_array($field_result)){
        echo '
<tr>'.chr(13);
        echo '
<td class="c1">'.$f['COLUMN_NAME'].'</td>

'.chr(13);
        echo '
<td class="c2">'.$f['COLUMN_TYPE'].'</td>

'.chr(13);
        echo '
<td class="c3">'.$f['COLUMN_DEFAULT'].'</td>

'.chr(13);
        echo '
<td class="c4">'.$f['COLLATION_NAME'].'</td>

'.chr(13);
        echo '
<td class="c5">'.$f['COLUMN_COMMENT'].'</td>

'.chr(13);
        echo '</tr>

'.chr(13);
    }
    echo '</table>

';

}
mysql_close($mysql_conn);
</pre>
<p>html风格页面</p>
<pre name="code" class="brush:html">
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
<style>
    table{ border-collapse:collapse;border:1px solid #CCC;background:#efefef;width:100%; margin-bottom:1em;}  
    table th{ text-align:left; font-weight:bold; padding:.5em 2em .5em .75em; line-height:1.6em; font-size:12px; border:1px solid #CCC;}  
    table td{ padding:.5em .75em; line-height:1.6em; font-size:12px; border:1px solid #CCC;background-color:#fff;}
    .c1{ width: 150px;}
    .c2{ width: 120px;}
    .c3{ width: 130px;}
    .c4{ width: 130px;}
    caption{ font-size:14px; font-weight:bold; line-height:2em; text-align:left; }
    </style>

</head>
<body>

<!-- 上面的php代码 -->

</body>
</html>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/dict-tools/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用于解决iframe自适应高度</title>
		<link>http://www.simcn.com/iframe-auto-height</link>
		<comments>http://www.simcn.com/iframe-auto-height#comments</comments>
		<pubDate>Thu, 18 Jun 2009 08:43:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[默认分类]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.simcn.com/2009/06/%e7%94%a8%e4%ba%8e%e8%a7%a3%e5%86%b3iframe%e8%87%aa%e9%80%82%e5%ba%94%e9%ab%98%e5%ba%a6/</guid>
		<description><![CDATA[function reinitIframe(){ var iframe = document.getElementById("frame_content"); try{ var bHeight = iframe.contentWindow.document.body.scrollHeight; var dHeight = iframe.contentWindow.document.documentElement.scrollHeight; var height = Math.max(bHeight, dHeight); iframe.height = height; }catch (ex){} } window.setInterval("reinitIframe()", 1000); 在新浪站上看到的不错，收藏下. 目前我们自己常用的 调用页面. function call_frame(height){ if(height){ document.getElementById('frame').style.height = height + 'px' ; } } 被调用页面 window.onload = function(){ var height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); parent.call_frame(height) }]]></description>
			<content:encoded><![CDATA[<pre name="code" class="brush:javascript">
function reinitIframe(){
	var iframe = document.getElementById("frame_content");
	try{
		var bHeight = iframe.contentWindow.document.body.scrollHeight;
		var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
		var height = Math.max(bHeight, dHeight);
		iframe.height =  height;
	}catch (ex){}
}
window.setInterval("reinitIframe()", 1000);
</pre>
<p>在新浪站上看到的不错，收藏下.</p>
<p>目前我们自己常用的</p>
<p>调用页面.</p>
<pre name="code" class="brush:html">
<script type="text/javascript">
    function call_frame(height){                
        if(height){
            document.getElementById('frame').style.height = height + 'px' ;
        }
    }
</script>
<iframe id="frame" src="iframe.html" width="400" frameborder="0"></iframe>
</pre>
<p>被调用页面</p>
<pre name="code" class="brush:js">
        window.onload = function(){
                var height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
                parent.call_frame(height)
            }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simcn.com/iframe-auto-height/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

