顯示具有 web develope 標籤的文章。 顯示所有文章
顯示具有 web develope 標籤的文章。 顯示所有文章

2010年8月18日 星期三

網頁無快取 meta

使得更新結果可以立即顯示

< meta content="no-cache" http-equiv="cache-control">
< meta content="no-cache" http-equiv="pragma">
< meta content="0" http-equiv="expires">

2010年8月13日 星期五

[jQuery] Ajax parseerror 之參考解決方案

問題:試圖用flash選單傳一個GET變數給Server,Server再以aspx輸出傳回XML,但一直遇到parseerror (也就是說直接讀.xml可以,但無法讀.aspx)

function ShowTrackerLocation(param){
 //param is track id
 //alert(param);
 $.ajax(
  {
   url: 'trackerlocation.aspx',
   type: 'GET',
   data: {trackerID:param},
   dataType: 'xml',
   error: function(xhr,textStatus) {
    alert(textStatus);
    alert('Ajax request error');
   },
       success: function(xml) {
    //var val1 = $(data).find("node").attr("attr");
    alert('successful callback');
    $(xml).find("node").each(function(){
     alert('successful callback');
    })
   }
  }
 );
 //mark 地標
}



解法
C#
Response.ContentType = "text/xml";

PHP
header('Content-type: text/html; charset=utf8');

無言的東西,浪費我一個下午時間亂試....

2010年3月14日 星期日

[CSS] 網頁設計小技巧 overflow:hidden

 overflow 屬性值 :
overflow: auto; /*預設使用捲軸*/
overflow: hidden; /*隱藏溢出範圍的內容*/
overflow: scroll; /*使標籤元素產生捲軸*/
overflow: visible; /*顯示全部忽略區塊大小*/
overflow: inherit; /*繼承父元素的可見性*/

IE 專用樣式
overflow-x:hidden; /*刪除水平捲軸*/
overflow-y:hidden; /*刪除垂直捲軸*/

參考

2010年2月19日 星期五

SyntaxHighlighter 2.1 + 試用

SyntaxHighlighter 2.1 解決之前不能處理 <<>>的問題
(經我實測結果結果還是會有點問題........可以輸出<<>> 但<>後面接續字母的話,會被當作tag...)

程式碼寫在< pre class="brush: 程式語言 > 你的程式碼< / pre>

brush code
ActionScript3 as3, actionscript3
Bash/shell bash, shell
C# c-sharp, csharp
C++ cpp, c
CSS css
Delphi delphi, pas, pascal
JavaScript js, jscript, javascript
Java java shBrushJava.js
JavaFX jfx, javafx
Perl perl, pl
PHP php
Plain Text plain, text
PowerShell ps, powershell
Python py, python
Ruby rails, ror, ruby
Scala scala
SQL sql
Visual Basic vb, vbnet
XML xml, xhtml, xslt, html, xhtml

測試範例..之前寫的亂數產生座標點
#include < iostream> 
#include < stdlib.h>
#include < iomanip>
#include < fstream> 
#include < time.h>
using namespace std; 

int main() { 
 
 //亂數種子
 time_t t;
 srand((unsigned) time(&t));
 
 // 資料的範圍...10*10 
 int dataspaceX;
 int dataspaceY;
 dataspaceX = 10;
 dataspaceY = 10;
 
 // transaction 筆數...1000筆
 int notrans;
 notrans = 100;
 
 //transaction length.....2~7
 int len;
 
 //create output file stream
 ofstream fout("db.txt"); 
 if(!fout) { 
        cout << "無法寫入檔案\n"; 
        return 1; 
    } 

 for(int i=0;i< notrans;i++){>
  //亂數決定每一筆transaction長度
  len = 2 + (rand() % 7);
  cout<< len;
  cout << endl; 
  fout << i+1 << " ";
  //亂數產生點
  for(int j=0;j< len;j++){>
   //產生 x,y
   int tmpX = 1 + rand() % dataspaceX;
   int tmpY = 1 + rand() % dataspaceY;
   //產生0~10的浮點數  
   fout << tmpX << "," << tmpY << "," << fixed << setprecision(1) << (float)10*(rand())/RAND_MAX << " ";
   //fout  << " ("<< tmpX << "," << tmpY << "," << (float)10*(rand())/RAND_MAX << ")";
   
  }
  fout << endl;  
 }
 fout.close();
 //printf("%.1f\n",(float)10*(rand())/RAND_MAX);
 //printf("%f\n",(float)3.4);
 //printf("%f\n", (float)(rand() % dataspace)/10);
 //printf("%d\n", rand() % dataspace);

 system("pause");
 return 0; 
} 

2008年7月26日 星期六

[套件]Web appears

好方便的網頁開發套件

http://www.webappers.com/

已經幫你把需要用的東西,e.g. 日曆、charts等都整理好

我這次用到的是Progress bar、percentage bar,另外還有poll system

http://www.webappers.com/progressBar/