Australian surfing star Mick Fanning has survived being attacked by a shark during the J-Bay Open World Surf League event in South Africa.