Short answer: No, there is no way to do this in Javascript for security reasons.
Long answer: Some plugins support UDP communications. For example, you could use Flash's Adobe AIR's DatagramSocket. If you are interfacing with an existing API which you cannot change, this might be your only option.
However, if you are building this app from scratch and intend to deploy it on the web, I would strongly suggest that you consider a different mode of transport. Take a look at LocalStorage or Shared Workers for browser-based IPC, Websockets for asynchronous client-server communication and WebRTC for peer-to-peer communication (although support for this standard is still a work in progress). This will allow you to support Apple devices and Linux as Adobe drops flash support on the platform, as well as provide better security guarantees than Flash or Java applets.