可先下載網上會計軟件 (http://www.memdb.com/download/MemAccWeb.exe), 安裝後按[伺服器設定], 預設WEB SERVER PORT是80, 按下[開啟伺服器], 成功應該可以在IE上登入, 編號是admin, 密碼是memdb.
登入後可以看到MENU, 按[傳票管理], 再按[加入傳票], 就能看到下圖:
如在IE按[...], 就能列出傳票讓用戶選擇帳戶, 或在帳戶編號輸入編號1210, 按[...] 就能自動選擇帳戶. 以上功能在IE完成沒問題.
但如在Google Chrome按[...]就不成功 (因為新版不支援showModalDialog), 它會CALL在安裝Folder內voucher.js中以下FUNCION:
function getAccCat(row,type)
{
alert("START");
var r;
var w = window.screen.availWidth-50;
var h = window.screen.availHeight-50;
if(inputForm['accCode'+row].value=='')
r = showModalDialog('?page=selectAccCat&type='+type, inputForm['accName'+row], 'status=0;resizable=1;scrollbars=1;dialogWidth=' + w + 'px;dialogHeight=' + h +'px;');
else
r = showModalDialog('?page=selectAccCat&accCode='+inputForm['accCode'+row].value, inputForm['accName'+row], 'status=0;resizable=1;scrollbars=1;dialogWidth=' + w + ';dialogHeight=' + h +';');
alert(r);
...
alert 是我後加的, 如alert(r)能出1210就成功, 不知以上問題有沒有人可以幫我 (當然IE和CHROME都能用), 如需要費用, 可向我提出.
http://blog.163.com/zhi_qingfang@126/blog/static/11747756320132218144825/
回覆刪除weijen6 :
回覆刪除http://blog.163.com/zhi_qingfang@126/blog/static/11747756320132218144825/
這我之前google過,但是都不能成功。
http://stackoverflow.com/a/28842258
回覆刪除Tam :
回覆刪除http://stackoverflow.com/a/28842258
謝謝, 但因為我十年沒有寫JAVASCRIPT, 而且我不會發展JAVASCRIPT, 想找人跟和升級這軟件和替MEMDB發展WEB APP, 這是提出這問題的目的.
有人願意花些時間去了解個voucher.js (這個是我十前前寫的, 現在已忘了如何寫了), 和更新這檔案, 令這軟件能繼續支援IE和CHROME嗎?
weijen6 :
回覆刪除http://blog.163.com/zhi_qingfang@126/blog/static/11747756320132218144825/
最新版的CHROME, 己不支援, 如我行
var returnValue = window.showModalDialog("login.html ", window);
都沒有SHOW個DIALOG了.
http://demo.agektmr.com/dialog/
回覆刪除https://github.com/niutech/showModalDialog
回覆刪除http://blog.bossma.cn/javascript/chrome-not-surpport-showmodaldialog-solution/
weijen6 :
回覆刪除http://demo.agektmr.com/dialog/
謝謝, 我想這是解決方案, 但我想請人幫手直接改 voucher.js, 他負責HTML5, 我可協助改個程式 (或遲些可以把程式都交給他), 因為始終要下放些工作下去.
YY :
回覆刪除Tam :
http://stackoverflow.com/a/28842258
謝謝, 但因為我十年沒有寫JAVASCRIPT, 而且我不會發展JAVASCRIPT, 想找人跟和升級這軟件和替MEMDB發展WEB APP, 這是提出這問題的目的.
有人願意花些時間去了解個voucher.js (這個是我十前前寫的, 現在...
YY :
回覆刪除Tam :
http://stackoverflow.com/a/28842258
謝謝, 但因為我十年沒有寫JAVASCRIPT, 而且我不會發展JAVASCRIPT, 想找人跟和升級這軟件和替MEMDB發展WEB APP, 這是提出這問題的目的.
有人願意花些時間去了解個voucher.js (這個是我十前前寫的, 現在...
If you've fixed the problem so just neglect it.
I've tried a .js file and seems it overcomes some aspects of your case. And I guess, need to modify your popup dialog to fix all the things.
https://drive.google.com/file/d/0By1mGveElQkZMnBHa2s2RkYtcHc/view?usp=sharing
Added one line to voucher.js to include the showModalDialog.js
The demo-modal.html is just for testing the return value. It works to get back return value but for your popup dialog, it failed. But it can get the text "現金" to the parent window. The close button of your dialog is also not work. In my new dialog box, top right corner it has the "cross" sign for close the dialog (dialog.close)
B :
回覆刪除YY :
Tam :
http://stackoverflow.com/a/28842258
謝謝, 但因為我十年沒有寫JAVASCRIPT, 而且我不會發展JAVASCRIPT, 想找人跟和升級這軟件和替MEMDB發展WEB APP, 這是提出這問題的目的...
with better dialog size version:
https://drive.google.com/file/d/0By1mGveElQkZdko3aWVpdHF0bEE/view?usp=sharing
B :
回覆刪除B :
YY :Tam :http://stackoverflow.com/a/28842258謝謝, 但因為我十年沒有寫JAVASCRIPT, 而且我不會發展JAVASCRIPT, 想找人跟和升級這軟件和替MEMDB發展WEB APP, 這是提出這問題的目的...
with better dialog size version:
https://drive.google.com/...
Thank you B, i have found and tried that showModalDialog.js before but failed to make it pop-up. And now you help me to fix this pop-up problem. I will try to fix the select and close problem. Can you whatsapp me 93225064 and keep contact with me? I am looking for any chance to co-operate with you.
When the user selec the account, it will call:
回覆刪除function selectAccCat(accName,accCode)
{
window.dialogArguments.value=accName;
window.returnValue=accCode;
window.close();
}
however if i change window.close to dialog.close, it still not work for Chrome (and also not working on IE)
另外, 長遠是否用HTML5的 dialog tag會好過用那個showModalDialog.js呢?
回覆刪除If you are interested in, u can send me email info5@memdb.com, i can send you the source code of selectAccCat to investigate.
回覆刪除How to replace
回覆刪除onClick=window.close()
to close the window, i change to:
onClick=dialog.close()
But fail, i guess it is because 'dialog' is not defined.
YY :
回覆刪除B :
B :
YY :Tam :http://stackoverflow.com/a/28842258謝謝, 但因為我十年沒有寫JAVASCRIPT, 而且我不會發展JAVASCRIPT, 想找人跟和升級這軟件和替MEMDB發展WEB APP, 這是提出這問題的目的...
with better dialog size v...
https://drive.google.com/file/d/0By1mGveElQkZZndJMDhLV3d3Rkk/view?usp=sharing
please try this version. Added one line to showModalDialog.js to give the dialog an ID. My dialog demo html is with a workable close button.
YY :
回覆刪除另外, 長遠是否用HTML5的 dialog tag會好過用那個showModalDialog.js呢?
showModalDialog.js 就係 dynamic generate 個 html5 dialog tag
Thank you B.
回覆刪除I change
window.close() to
parent.document.getElementById('dialogModal').close();
It work in chrome, but fail in IE.
Also, the window.returnValue=accCode;
cannot return the value to the parent in chrome.
YY :
回覆刪除Thank you B.
I change
window.close() to
parent.document.getElementById('dialogModal').close();
It work in chrome, but fail in IE.
Also, the window.returnValue=accCo...
Because showModalDialog.js would use only if the browser supports showModalDialog, so u should use :
if (window.showModalDialog)
{
window.close();
}
else
{
parent.document.getElementById('dialogModal').close();
}
YY :
回覆刪除Thank you B.
I change
window.close() to
parent.document.getElementById('dialogModal').close();
It work in chrome, but fail in IE.
Also, the window.returnValue=accCo...
Because showModalDialog.js would use <dialog> only if the browser supports showModalDialog, so u should use :
if (window.showModalDialog)
{
window.close();
}
else
{
parent.document.getElementById('dialogModal').close();
}
YY :
回覆刪除Thank you B.
I change
window.close() to
parent.document.getElementById('dialogModal').close();
It work in chrome, but fail in IE.
Also, the window.returnValue=accCo...
我開頭試,見佢個帳戶名稱傳得翻上 parent,所以我估個編號都應該得,但係我冇 code 睇唔倒,咁不如你俾 "建立傳票" 同 "帳戶選擇" 嘅 html 我望望,thx.
B :
回覆刪除YY :
Thank you B.
I change
window.close() to
parent.document.getElementById('dialogModal').close();
It work in chrome, but fail i...
Sorry, I mean :
Because showModalDialog.js would use only if the browser doesn't support showModalDialog
B :
回覆刪除YY :
Thank you B.
I change
window.close() to
parent.document.getElementById('dialogModal').close();
It work in chrome, but fail i...
Sorry, I mean :
Because showModalDialog.js would use <dialog> only if the browser doesn't support showModalDialog
https://drive.google.com/file/d/0By1mGveElQkZdFZGLVg3VjZOZTA/view?usp=sharing
回覆刪除updated selectAccCat.
ok to close for both ie and chrome.
accName ok for both as before.
only accCode failed.
because window.returnValue doesn't work for chrome now.
I would try to fix it later.
B :
回覆刪除YY :
Thank you B.I changewindow.close() toparent.document.getElementById('dialogModal').close();It work in chrome, but fail in IE.Also, the window.returnValue=accCo...
我開頭試,見佢個帳戶名稱傳得翻上 parent,所...
You can see the HTML source in IE, or change the document.oncontextmenu= ContextMenu; in common.js
YY :
回覆刪除B :
YY :
Thank you B.I changewindow.close() toparent.document.getElementById('dialogModal').close();It work in chrome, but fail in IE.Also, the window.returnValue=...
u've hardcoded to control the context menu and it can't be controlled by common.js
So I use alert to show the innerHTML.
B :
回覆刪除https://drive.google.com/file/d/0By1mGveElQkZdFZGLVg3VjZOZTA/view?usp=sharing
updated selectAccCat.
ok to close for both ie and chrome.
accName ok for both as befor...
https://drive.google.com/file/d/0By1mGveElQkZZnkzX0VGbGFqRzA/view?usp=sharing
updated voucher.js, showModalDialog to use dialogArguments to transfer both accCode and accName to the parent window. Really no way to transfer by returnValue. Seems need to rewrite all the related parts.
Thank you a lot, yes, it still needs to change a lot. For example, I put arlert after showModalDialog and it will not run.
回覆刪除r = showModalDialog(...);
alert(r);
That cause a problem when selecting the account, if I click [收入] in tab, it will not let me to select account in [收入], secondly, it will not setfocus on the "description" field.
YY :
回覆刪除Thank you a lot, yes, it still needs to change a lot. For example, I put arlert after showModalDialog and it will not run.
r = showModalDialog(...);
alert(r);
Th...
alert(r) will not run is due to the last line (throw;) of showModalDialog.js
It's ok to run anything if u remarked that line.
The returnValue doesn't work because the dialog tag is generated dynamically.
And the relationship of showModalDialog to the parent window is totally different to the dialog tag and the parent window.
For transfer the values between them can be implemented by the dialogArguments. But all the things related to returnValue must be rewrite for chrome.
YY :
回覆刪除Thank you a lot, yes, it still needs to change a lot. For example, I put arlert after showModalDialog and it will not run.
r = showModalDialog(...);
alert(r);
Th...
alert(r) will not run is due to the last line (throw;) of showModalDialog.js
It's ok to run anything if u remarked that line.
The returnValue doesn't work because the dialog tag is generated dynamically.
And the relationship of showModalDialog to the parent window is totally different to the dialog tag and the parent window.
For transfer the values between them can be implemented by the dialogArguments. But all the things related to returnValue must be rewrited for chrome, although it should be easy.
B :
回覆刪除YY :
Thank you a lot, yes, it still needs to change a lot. For example, I put arlert after showModalDialog and it will not run.r = showModalDialog(...);alert(r);Th...
alert(r) will not run is d...
Thank you B.
I have tried it but still fail (for changing tabs 收入, 支出. I think we may need to spend more time on it.
Do you still want to try? Or anyway we can co-opearte to fix it more efficiently? Or email me to discuss? info5@memdb.com
Here is what I did:
回覆刪除http://www.memdb.com/download/MemAccWeb2.exe
I need two feactures:
1) After I select the account 1220, it will focus on the 摘要 fields.
2) If I click [收入] tab (it will call selectAccCat("收入",4), it will show all 收入 account for me, and I can select 4100
I have change to call dialogClose when user click [關閉].
If you need source code of the ?page=selectAccCat&type='+type, email to me, I can send it for you.
Really thank you for helping me.
B :
回覆刪除YY :
Thank you a lot, yes, it still needs to change a lot. For example, I put arlert after showModalDialog and it will not run.r = showModalDialog(...);alert(r);Th...
alert(r) will not run is d...
Hi B, someone has helped me to fix it using iframe src. I remember you have emailed about yourselve before but sorry, I missed that email, can you re-email me again, I hope we can keep in touch and work together in future.
YY :
回覆刪除B :
YY :
Thank you a lot, yes, it still needs to change a lot. For example, I put arlert after showModalDialog and it will not run.r = showModalDialog(...);alert(r...
good. iframe may be easy and better for your situation because the dom relationship is similar to the showModalDialog. I just try to use the html5 <dialog> to implement it.
I can't remember if I've emailed u before and I should not know your email address. Anyway sure u're welcome to email me. I just coding for fun.
B :
回覆刪除YY :
B :YY :Thank you a lot, yes, it still needs to change a lot. For example, I put arlert after showModalDialog and it will not run.r = showModalDialog(...);alert(r...
good. iframe may be eas...
Can you email to me (info5@memdb.com) and tell me more about you? I like making friends with those coding for fun. Thank you your help.