call mac function by webpage