Skip to content

Instantly share code, notes, and snippets.

@koduki
Created July 31, 2009 18:06
Show Gist options
  • Save koduki/159351 to your computer and use it in GitHub Desktop.
Save koduki/159351 to your computer and use it in GitHub Desktop.
-- 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