Detect Event Type in jQuery

David Meador
Updated on 17-Feb-2020 09:48:11

187 Views

To detect the eventType in jQuery, use the event type property. You can try to run the following code to learn how to detect eventType in jQuery −ExampleLive Demo  $(document).ready(function(){     $("p").on("mouseover mouseout",function(event){         $("div").html("Event Type: " + event.type);     });  }); This has mouseover and mouseout event defined. Keep your cursor to see the event type below.

List of Views in a MySQL Database

Chandu yadav
Updated on 17-Feb-2020 08:54:10

191 Views

With the help of following queries,  we can see the list of views stored in a particular database. We are using the database named ‘query’ here.mysql> SELECT TABLE_NAME FROM information_schema.`TABLES` WHERE TABLE_TYPE LIKE'view' AND TABLE_SCHEMA LIKE 'query'; +-----------------------------+ | TABLE_NAME                  | +-----------------------------+ | customer_view               | | first_view                  | | info                        | | info_less                   | | view_detail   ... Read More

Deserialize JSON String Using @JsonCreator Annotation in Java

raja
Updated on 17-Feb-2020 08:18:20

992 Views

The @JsonProperty annotation can be used to indicate the property name in JSON. This annotation can be used for a constructor or factory method. The @JsonCreator annotation is useful in situations where the @JsonSetter annotation cannot be used. For instance, immutable objects do not have any setter methods, so they need their initial values injected into the constructor.@JsonProperty - ConstructorExampleimport com.fasterxml.jackson.annotation.*; import java.io.IOException; import com.fasterxml.jackson.databind.*; public class JsonCreatorTest1 {    public static void main(String[] args) throws IOException {       ObjectMapper om = new ObjectMapper();       String jsonString = "{\"id\":\"101\", \"fullname\":\"Ravi Chandra\", \"location\":\"Pune\"}";       System.out.println("JSON: " + jsonString);   ... Read More

Create Multiple Databases in SAP HANA System

Monica Mona
Updated on 17-Feb-2020 08:16:55

423 Views

In SAP HANA, you don’t have a concept of creating multiple databases in one container. To create a separate container for your database objects, you can create the schema in HANA db.To create a schema, you can use below SQL query −CREATE SCHEMA schema nameYou can also define as owner name while defining a schema.CREATE SCHEMA [OWNED BY ]If it is not defined, the system takes the current user as the owner of the schema.

Use of SPATIAL Function in SAP HANA

Lakshmi Srinivas
Updated on 17-Feb-2020 08:11:42

276 Views

In SAP HANA, geospatial data types are not defined as such and you need to use scalar values like a.ST_X().You can create a table like this −CREATE COLUMN TABLE MYSCHEMA.SpatialShapes_GEOMETRIES (    ShapeID integer,    SHAPE1 ST_Point,    SHAPE2 ST_GEOMETRY );SAP provides a complete guide to handle Geospatial data in applications. You can refer this link for more details:https://help.sap.com/doc/PRODUCTION/9db42d044f8e415180d4a4475873b50a/2.0.00/en-US/SAP_HANA_Spatial_Reference_en.pdf

Append an Element Before Another Element Using jQuery

David Meador
Updated on 17-Feb-2020 08:06:23

3K+ Views

To append an element before an element, use the insertBefore() method. The insertBefore( selector) method inserts all of the matched elements before another, specified, set of elements.ExampleLive Demo           The jQuery Example                              $(document).ready(function() {             $("div").click(function () {                $("#source").insertBefore(this);             });          });                              .div {              margin:10px;              padding:12px;              border:2px solid #666;              width:60px;          }                             Click on any square below to see the result:                                            

Set HTML Content of an Element using jQuery

David Meador
Updated on 17-Feb-2020 08:05:35

793 Views

To set the HTML content of an element, use the html() method. You can try to run the following code to get HTML content of an element using jQuery −ExampleLive Demo $(document).ready(function(){     $("#button1").click(function(){         $("#demo").html("This text is highlighted.");     }); }); This is a paragraph. Click to set HTML

Wrap Multiple DIVs in One with jQuery

David Meador
Updated on 17-Feb-2020 08:04:40

2K+ Views

To wrap multiple divs in one with jQuery, use the wrapAll() method. You can try to run the following code to wrap multiple divs in one with jQuery −ExampleLive Demo $(document).ready(function() {    $("#button1").click(function(){       $('.b,.c').wrapAll('');      }); }); .wrap {   color:blue; }  This is div 1  This is div 2  This is div 3 Wrap

Wrap Two Adjacent Elements in a Containing Div using jQuery

David Meador
Updated on 17-Feb-2020 07:55:08

359 Views

To wrap two adjacent elements, loop through each myclass, add it to array and determining the next element has a .myclass. You can try to run the following code to learn how to wrap two adjacent elements in a containing div −ExampleLive Demo $(document).ready(function() {     var result = [];         $('.myclass').each(function() {         var box2 = $(this).next().hasClass('myclass');                 result.push($(this));                 if(!box2)         {             var container = $('');             container.insertBefore(result[0]);             for(x=0;x

Best Way to Add DOM Elements with jQuery

David Meador
Updated on 17-Feb-2020 07:53:56

176 Views

The best way to add DOM elements with jQuery is to append the HTML string, using append() method. You can try to run the following code to insert DOM element −ExampleLive Demo           The jQuery Example                              $(document).ready(function() {             $("div").click(function () {                $(this).append('' );             });          });                              .div {             margin:10px;             padding:12px;             border:2px solid #666;             width:60px;          }                             Click on any square below to see the result:                                      

Advertisements