把圖片放在 table 裡, 再把 table id 改成 wrapper 即可。
html, body, #wrapper {
height:100%;
margin: 0;
text-align: center;
}
#wrapper {
margin: 0 auto;
}
把圖片放在 table 裡, 再把 table id 改成 wrapper 即可。
html, body, #wrapper {
height:100%;
margin: 0;
text-align: center;
}
#wrapper {
margin: 0 auto;
}
一些簡單的步驟即可。
$raw_text = file_get_contents( "http://www.google.com"); $utf8_text = iconv( $encoding, "utf-8", $raw_text ); $utf8_text = html_entity_decode( $utf8_text, ENT_QUOTES, "UTF-8" );
在 oReilly 的書上看到一個例子, 幾個 function retrieve URL 很有用。
工作需要把一個 folder 裡的 text file 轉成 html
這個網站有sample code, 只要寫個function read directory,
把 filename 放到 array 裡即可。
另一個手工打造的 Jquery 例子.較輕巧方便。
http://15daysofjquery.com/edit-in-place-with-ajax-using-jquery-javascript-library/15/
今天應朋友之約跟書的例子做了一個簡單的 相反移動的 photo slide,
DEMO
圖片都是hard code 在 flash 中. 其實可以做 xml load external photo.
大家可自行研究 source code 改進。
由於公司的 SERVER 不支援 SERVER SIDE programming 和沒有 DB .
要做Data searching and filtering 唯有借助 xml,
用 xsl接收不同的參數做不同的模版,
再用 javascript 把 xml transform 成 HTML
詳細看了這個網站的 例子和 source code, 終於成功。
http://msell.customer.netspace.net.au/
做 backend DB 常常要處理 single quote, double quote 在 sql 裡的問題,
尤其是php 不知server 是否 開啟了 get_magic_quotes_gpc() 設定,
所以用addslashes並不是好方法.
在網上找到這個處理方法, 很不錯,或者用 str_replace把
single quote, double quote 變成 htmlentities。
if(!get_magic_quotes_gpc())
{
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}else
{
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
用 PHP 內置 function filegetcsv 去 parse CSV file, 常有 big5, utf8 亂碼問題。
最後還是用原始方法, 逐行 read, 再用 explode 變成2d array. 才解決到問題。
$dataArr = file(data.txt);
for ($i=0;$i<count($dataArr);$i++){
$line = explode("~", $dataArr[$i]);
foreach($line as $value) {
$finalData[$i][] = $value;
}
}