How do you deal with these jellyfish?
I just got into Jabu-Jabu's belly, and there's annoying enemies all over the place. Jellyfish are only one among them. Two others I've seen are bubbles and floating lamprey-ish guys. If I attack any of them with my sword, I take damage. They are all immune to my slingshot.
How do I deal with these enemies?
Wipqozn has it right. Use the boomerang.
However until you get the boomerang, you should be able to fight them with deku sticks. Also using the magical charge attack seems to work.
http://strategywiki.org/wiki/The_Legend_of_Zelda:_Ocarina_of_Time/Jabu-Jabu%27s_Belly
In the second room there are several jellyfish called Biri. Keep away from them. They are invulnerable to Deku Seeds from your Slingshot and give you a shock if you try to kill them with your sword. However, remember the Spin Attack you learned? Utilize that attack on them so that they won't injure you. If you hold the attack long enough, it will grow more powerful and you can release a Super Spin Attack that reaches further. However, it takes magic to use this attack. Some enemies drop Magic Jars you can use to keep your magic meter filled. If you have deku sticks with you, you can use them to fight the Biri without getting shocked.
The easiest way to kill them is with the Boomerang, which you find in Jabu-Jabu's belly. If you don't have boomerang though you have a few other options, as outlined here. A deku nut will stun them, allowing you to attack them, and a deku stick will be able to damage them without getting shocked without needing to stun them first. Bombs will also work, as detailed here. Amusingly enough you can also kill them by throwing Princess Ruto at them.