Prabhas has Published 78 Articles

What is the difference between MySQL NOW() and CURDATE() function?

Prabhas

Prabhas

Updated on 28-Jan-2020 10:57:02

1K+ Views

As the name suggests CURDATE() function will return the current date. In simple words, we can say that it would return only the date not time.mysql> select CURDATE(); +------------+ | CURDATE()  | +------------+ | 2017-10-28 | +------------+ 1 row in set (0.00 sec)In contrast, NOW() function will return current date ... Read More

How to search a record by date in MySQL table?

Prabhas

Prabhas

Updated on 28-Jan-2020 09:22:39

758 Views

Suppose we have a table ‘Order123’ having ProductName, Quantity and OrderDate columns as follows −mysql> Select * from Order123; +-------------+----------+------------+ | ProductName | Quantity | OrderDate  | +-------------+----------+------------+ | A           | 100      | 2017-05-25 | | B           | ... Read More

What are syntax errors in JavaScript?

Prabhas

Prabhas

Updated on 16-Jan-2020 08:44:48

176 Views

Syntax errors also called parsing errors, occur at compile time in traditional programming languages and at interpret time in JavaScript. For example, the following line causes a syntax error because it is missing a closing parenthesis.     When a syntax error occurs in JavaScript, only the code contained within ... Read More

How to create JavaScript alert with 3 buttons (Yes, No and Cancel)?

Prabhas

Prabhas

Updated on 10-Jan-2020 10:30:53

3K+ Views

The standard JavaScript alert box won’t work if you want to customize it. For that, we have a custom alert box, which we’re creating using jQuery and styled with CSS.ExampleYou can try to run the following code to create an alert box with 3 buttons i.e Yes, No and Cancel. ... Read More

How to set cookies to expire in 30 minutes in JavaScript?

Prabhas

Prabhas

Updated on 09-Jan-2020 08:07:48

5K+ Views

You can extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the ‘expires’ attribute to a date and time.ExampleYou can try to run the following example to set cookies ... Read More

What are some JavaScript Development Tools?

Prabhas

Prabhas

Updated on 02-Jan-2020 08:30:57

333 Views

One of the major strengths of a JavaScript is that it does not require any expensive development tools. You can start with a simple text editor such as Notepad. Since it is an interpreted language inside the context of a web browser, you don't even need to buy a compiler.To ... Read More

How can I trigger a JavaScript click event?

Prabhas

Prabhas

Updated on 03-Oct-2019 07:46:57

1K+ Views

To trigger a JavaScript click event, let us see the example of mouse hover.ExampleLive Demo           Hover over the button.                                      function display() {             document.getElementById("test").click();          }          

Why is case sensitivity so much more important in JavaScript?

Prabhas

Prabhas

Updated on 30-Sep-2019 07:41:32

67 Views

A script is in plain text and not just markup like HTML, which is case insensitive. In JavaScript, the while keyword, should be "while", not "While" or "WHILE". Case sensitivity is important since it is closely related to HTML, but some methods and events are mentioned differently.Some tags and attributes ... Read More

What are the various types of comments in JavaScript?

Prabhas

Prabhas

Updated on 12-Sep-2019 08:20:29

112 Views

Single Line commentThe following is a single line comment in JavaScript. Any text between a // and the end of a line is treated as a comment and is ignored by JavaScript.// This is a comment. It is similar to comments in C++Multi-Line commentThe following is a multi-line comment in ... Read More

When is a CDATA section necessary within a script tag?

Prabhas

Prabhas

Updated on 12-Sep-2019 07:56:43

529 Views

To avoid parsing the symbols &, it is added in …. It is not needed in HTML. Let us see how CDATA is added in tags:    // Note: CDATA is now deprecated. Do not use.The CDATA Section interface is used within XML for including extended portions of ... Read More

Advertisements