Created
July 31, 2009 18:06
-
-
Save koduki/159351 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- client side | |
<script> | |
function f = 2 | |
function echo = ... | |
//一番近いfを呼ぶので2 | |
alert(f()); | |
//クライアントにmath.fが無いので2 | |
alert(math.f()); | |
//名前空間でclientを指定してるので2 | |
alert(client.f()); | |
//名前空間でserverを指定してるので1 | |
alert(server.math.f()); | |
//存在しないのでエラー | |
alert(f2()); | |
</script> | |
--- server side | |
// サーバにはechoが存在しないのでclientのechoが呼ばれる | |
echo('hello'); | |
namespace math{ | |
function f = 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment