Relative location for wpapi in js