這麼簡單!
哈哈!
本網誌記錄網站設計的一些內容筆記。 網站設計需要整合很多工具與概念。 我畢業自淡江電子計算機科學學系,算是科班出身。但我們那個年代(50年代,唉!LKK了!),網路還只是剛開始,相關的技術都是出社會以後陸續接觸學習。 網站的建立與設計,牽涉的範圍真的很廣泛。 網站的目地是甚麼?銷售網頁、電子購物、廣告、社群經營、互動、教學、客戶服務、網站應用程式、...... 需要整合的人才,程式設計師、資料庫管理師、網頁美編、文字編輯、多媒體製作等等。 這裡將記錄一個LKK對網站系統重新學習與複習,還有教學使用的一些資料。
Method | Description |
---|---|
$.ajax() | Performs an async AJAX request |
$.ajaxPrefilter() | Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax() |
$.ajaxSetup() | Sets the default values for future AJAX requests |
$.ajaxTransport() | Creates an object that handles the actual transmission of Ajax data |
$.get() | Loads data from a server using an AJAX HTTP GET request |
$.getJSON() | Loads JSON-encoded data from a server using a HTTP GET request |
$.getScript() | Loads (and executes) a JavaScript from a server using an AJAX HTTP GET request |
$.param() | Creates a serialized representation of an array or object (can be used as URL query string for AJAX requests) |
$.post() | Loads data from a server using an AJAX HTTP POST request |
ajaxComplete() | Specifies a function to run when the AJAX request completes |
ajaxError() | Specifies a function to run when the AJAX request completes with an error |
ajaxSend() | Specifies a function to run before the AJAX request is sent |
ajaxStart() | Specifies a function to run when the first AJAX request begins |
ajaxStop() | Specifies a function to run when all AJAX requests have completed |
ajaxSuccess() | Specifies a function to run when an AJAX request completes successfully |
load() | Loads data from a server and puts the returned data into the selected element |
serialize() | Encodes a set of form elements as a string for submission |
serializeArray() | Encodes a set of form elements as an array of names and values |
function showCustomer(str) {
var xhttp;
if (str == "") {
document.getElementById("txtHint").innerHTML = "";
return;
}
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xhttp.responseText;
}
};
xhttp.open("GET", "getcustomer.asp?q="+str, true);
xhttp.send();
}
$db = new clsDBmysql_conn();
$SQL = "SELECT max(qf_id) as maxid FROM quick_form WHERE refer_mem_extid='" .$_SESSION["mem_id"]."' AND finished='0';";
$db->query($SQL);
$Result = $db->next_record();
if ($Result) {$_SESSION["qf_id"] = $db->f("maxid");} else {$_SESSION["qf_id"] = 0;}
object->DataSource->Where [=value]
IF NEW.execute_it = "1" THEN
-- Execute some code...
SET NEW.execute_it = "0";
ELSE
-- Execute the other code......
END IF;
SET NEW.execute_it = "0";
SELECT sum(quantity) FROM stock_card
LIMIT 0,2;
以上,這樣會得到所有記錄的總加總,而不是只有兩筆;
SELECT sum(quantity) FROM (SELECT quantity FROM stock_card LIMIT 0,2 ) AS subquery;
以上,這樣就可以僅僅兩筆的加總。
if(vswitch == 1)
{
document.getElementById('div_hidden_bloco_0').style.display = 'none'; //you need to determine the number of the block by inspecting the element in the browser
document.getElementById('div_hidden_bloco_1').style.display = 'block';
}
else
{
document.getElementById('div_hidden_bloco_0').style.display = 'block';
document.getElementById('div_hidden_bloco_1').style.display = 'none';
}
sc_ajax_javascript('switchBlocks',array(0)); //we need this because we can't call javascript from the onLoad event
{myaddress} = {name}.'<br>'.{address1}.'<br>'.{city}; {mybtn} = "<button type='button' onclick='switchBlocks(1)'>Edit</button>"; //could be beefed up with some css call_switchBlocks();
call_switchBlocks();
{same_addr_btn1}="<button type='button' onclick='sameaddress1()'>Same Address</button>";
$("select[name$='m_country_id']" ).val($("select[name$='country_id']").val());
$("input[name$='m_state']" ).val($("input[name$='state']").val());
$("input[name$='m_city']" ).val($("input[name$='city']").val());
$("input[name$='m_postcode']" ).val($("input[name$='postcode']").val());
$("input[name$='m_street1']" ).val($("input[name$='street1']").val());
$("input[name$='m_street2']" ).val($("input[name$='street2']").val());
Mark checkbox | Mark all the checkbox fields of the record. |
只要用 if (empty({primary_key})) 就可以知道是否為新增模式了。 如果 {promary_key} 是空白的,那麼就是在新增模式;反之,就是更新模式。 以上。