Subversion Repositories php-qbpwcf

Rev

Rev 232 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 232 Rev 239
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2014~2025 MIN ZHI, CHEN
6
    Copyright (C) 2014~2026 MIN ZHI, CHEN
7
 
7
 
8
    This file is part of QBPWCF.
8
    This file is part of QBPWCF.
9
 
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
11
    it under the terms of the GNU General Public License as published by
Line 8644... Line 8644...
8644
					//如果data不為空物件
8644
					//如果data不為空物件
8645
					if(params.data.toString()!=='[object Object]'){
8645
					if(params.data.toString()!=='[object Object]'){
8646
 
8646
 
8647
						//傳送要求
8647
						//傳送要求
8648
						xmlhttp.send(params.data);
8648
						xmlhttp.send(params.data);
8649
						
8649
 
8650
						}//if end
8650
						}//if end
8651
 
8651
 
8652
					//反之data存在資料
8652
					//反之data存在資料
8653
					else{
8653
					else{
8654
						//傳送要求,POST為空
8654
						//傳送要求,POST為空
Line 8663... Line 8663...
8663
 
8663
 
8664
					//直接傳送要求
8664
					//直接傳送要求
8665
					xmlhttp.send();
8665
					xmlhttp.send();
8666
 
8666
 
8667
					}//else end
8667
					}//else end
8668
					
8668
 
8669
				//其他不認得的 method
8669
				//其他不認得的 method
8670
				else{
8670
				else{
8671
				
8671
 
8672
					//初始化儲存結果的物件
8672
					//初始化儲存結果的物件
8673
					var res={};
8673
					var res={};
8674
				
8674
 
8675
					//設置錯誤訊息
8675
					//設置錯誤訊息
8676
					res.error='unknow method:'+params.method;
8676
					res.error='unknow method:'+params.method;
8677
					
8677
 
8678
					//設置執行異常
8678
					//設置執行異常
8679
					res.status='false';
8679
					res.status='false';
8680
					
8680
 
8681
					//receive
8681
					//receive
8682
					resolve(res);
8682
					resolve(res);
8683
				
8683
 
8684
					}//else end
8684
					}//else end
8685
 
8685
 
8686
				});//Promise end
8686
				});//Promise end
8687
 
8687
 
8688
			}//function window.qbpwcf.ajaxP end
8688
			}//function window.qbpwcf.ajaxP end