I can't understand why sometimes you use host/domain names that end with ".com.au" and sometimes you use names that end with ".com".
May you also clarify which constraints your application server imposes you on the names you can use? Does it also affect the generation of javascript code?
Referring to the above client code, setting
should work.Code:page.context.setDomain("mysite.com.au");
Moreover, as the domain is only a pattern, you don't need a hosts file entry for the domain name.
Bookmarks