Javascript Articles

Page 524 of 534

Advanced JavaScript Backend Basics

sudhir sharma
sudhir sharma
Updated on 16-Oct-2019 821 Views

JavaScript programming language that is usually used for web scripting. It is a lightweight, interpreted programming language. JavaScript is one of the most programming languages for web development. For running JavaScript each browser has its own engine which enables the proper functioning of JavaScript in the browser. Some common Browsers and their JavaScript engines are −Spider Monkey for firefoxV8 for Google ChromeJavaScript code for SafariChakra for Microsoft Internet Explorer/ edgeTo make JavaScript universe and stop a browser from describing their own scripts. There is a standard set for JavaScript which will be used throughout the browser. there is an Association ...

Read More

How to convert MySQL DATETIME value to JSON format in JavaScript?

AmitDiwan
AmitDiwan
Updated on 07-Oct-2019 709 Views

To convert, use JSON.stringify(). Following is the code to convert MySQL DATETIME value to JSON format in JavaScript − var mySQLDateTime = new Date("Fri Sep 06 2019 22 −54 −48 "); var yearValue = mySQLDateTime.getFullYear(); var dateValue = mySQLDateTime.getDate(); var monthValue=mySQLDateTime.getMonth(); var hour=mySQLDateTime.getHours(); var minutes=mySQLDateTime.getMinutes(); var second=mySQLDateTime.getSeconds(); jsonObject={"year" −yearValue,"month" :monthValue,"DateValue" :dateValue,"Hour" :hour ,"Minutes" :minutes,"Second" :second}; var dateJsonObject = JSON.stringify(jsonObject); document.write(dateJsonObject); The screenshot of the code is as follows −This will produce the following output −{"year" :2019,"month" :8,"DateValue" :6,"Hour" :22,"Minutes" :54,"Second" :48}The snapshot of the output is as follows −

Read More

How to Validate your Website Code?

Rahul Sharma
Rahul Sharma
Updated on 04-Oct-2019 338 Views

Website development included writing code in HTML, CSS, JavaScript and the platform you’ve chosen. Your website may look correct, responsive and developed with website standards, but it may have some internal issues.Tools are provided by W3C, to validate your website code:Validate HTML5Validator.nu is a validator, which validates HTML5, ARIA, SVG 1.1 and MathML 2.0. It checks the complete document and points out where the markup isn’t following the doctype.W3C Markup ValidatorIt checks the HTML doctype and the markup. This validator is for those who are using HTML4 or XHTML1.x doctype. It also validates HTML5, but Validator.nu is considered far better since ...

Read More

What are the differences between JavaScript and PHP cookies?

Anvi Jain
Anvi Jain
Updated on 03-Oct-2019 885 Views

JavaScript CookiesUsing JavaScript cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.PHP CookiesCookies are text files stored on the client computer and they are kept for tracking purpose. PHP transparently supports HTTP cookies.How JavaScript cookies work?Your server sends some data to the visitor's browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor's hard drive. Now, when the visitor arrives at another page on your site, the browser ...

Read More

How to define methods for an Object in JavaScript?

Nancy Den
Nancy Den
Updated on 03-Oct-2019 217 Views

Methods are the functions that let the object do something or let something is done to it. There is a small difference between a function and a method – at a function is a standalone unit of statements and a method is attached to an object and can be referenced by this keyword.Methods are used for everything from displaying the contents of the object to the screen to performing complex mathematical operations on a group of local properties and parameters. Here’s an example showing how to use the write() method of the document object to write any content on the document.document.write("This ...

Read More

How can I trigger a JavaScript click event?

Prabhas
Prabhas
Updated on 03-Oct-2019 2K+ Views

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

Read More

How to set named cookies in JavaScript?

vanithasree
vanithasree
Updated on 03-Oct-2019 629 Views

To set named cookie in JavaScript, run the following code. It sets a customer name in an input cookie. Example                                Enter name:              

Read More

How to trigger event in JavaScript?

Vikal Singh
Vikal Singh
Updated on 03-Oct-2019 901 Views

The trigger() method triggers the specified event and the default behaviour of an event (like form submission) for the selected elements.For example: $( "#foo" ).on( "click", function() {   alert( $( this ).text() ); }); $( "#foo" ).trigger( "click" );

Read More

How to call a Java function inside JavaScript Function?

usharani
usharani
Updated on 03-Oct-2019 6K+ Views

JavaScript cannot call java method directly since it is on the server. You need a Java framework like JSP to call when a request is received from JavaScript. Let’s see how to use JSP to call a Java function inside JavaScript function.Here’s the JavaScript code://javascript code function initiateFunc() {    $.get('localhost/project/myexecution.jsp); } $( initiateFunc); Here’s the JSP code for “myexecution.jsp”:

Read More

How to disable JavaScript in Internet Explorer (IE)?

vanithasree
vanithasree
Updated on 30-Sep-2019 450 Views

To disable JavaScript in Internet Explorer (IE), follow the below-given steps:Click the gear icon on the right-hand side:Now, a dialog box will open. Go to Security tab and click Custom level.After reaching the Security Settings, go to Scripting, then Active Scripting.Click Disable to disable JavaScript and press Ok.Now, JavaScript will disable after clicking Ok.

Read More
Showing 5231–5240 of 5,339 articles
« Prev 1 522 523 524 525 526 534 Next »
Advertisements