Posts

Showing posts from December, 2022

Using javascript pass form variables to iframe src

Image
   Open PDF in Bootstrap Modal Window   This tutorial shows How to pass a JavaScript/jQuery variable to bootstrap modal view and sets it to iframe  src attribute. It passes value dynamically to src attribute of the iframe. When the user clicks a link, it opens the URL in a popup window. This  code shows the PDF in a Model without download option by hiding the toolbar.  To show PDF toolbar in modal, just add #toolbar=1   in the above script. index.php <!DOCTYPE html> <html lang= "en" > <head> <title>Bootstrap Model with PDF Example - coding-zon</title> <meta charset= "utf-8" > <meta name= "viewport" content= "width=device-width, initial-scale=1" > <link rel= "stylesheet" href= "https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" > <script src= "https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.

Java Networking Datagrams Tutorial

Image
Client server communication with Datagrams     Java Networks Home Generally, Datagrams are transmits  packets of information between machines. Once the datagram has released to its intended target, there is no assurance that it will arrive without loss of data. Java implements datagrams on top of UDP protocol by using 2 classes. They are.. 1 . DatagramSocket constructors DatagramSocket() throws SocketException DatagramSocket( int port) throws SocketException DatagramSocket( int port,InetAddrss ipaddress) throws SocketException DatagramSocket(SocketAddress address) throws SocketException SocketAddress It is an abstract class implemented by concrete class InetSocketAddress. It encapsulates an IP address with a port no. methods void send (DatagramPacket packet) throws IOException void receive (DatagramPacket packet) throws IOException 2 . DatagramPacket its object is the data container. DatagramPacket ( byte data[], int size) DatagramPacket( byte data[], i