How to load a page in div using jQuery?

Amit D
Published on 21-Dec-2017 11:50:45
To load a page in div in jQuery, use the load() method. Firstly, add the web page you want to add.Here’s the code for new.html −<html> <head>     </head> <body> <p>This is demo text.<p> </body> </html>ExampleNow, the code snippet for the file which adds the above page, <!DOCTYPE html> ... Read More

How do I calculate the date six months from the current date using the datetime Python module?

Rajendra Dharmkar
Published on 21-Dec-2017 11:49:35
You can use the timedelta function from datetime module to achieve this. For example, >>> import datetime >>> today = datetime.date.today() >>> print today 2017-09-12 >>> six_months_later = today + datetime.timedelta(30*6) >>> print six_months_later 2018-03-11Read More

What is jQuery.ajaxSetup() method in jQuery?

Amit D
Published on 21-Dec-2017 11:48:28
The jQuery.ajaxSetup() method sets global settings for future AJAX requests. Here is the description of all the parameters used by this method-Let’s say we have the following HTML content in result.html file, <h1>THIS IS RESULT...</h1>The following is an example showing the usage of this method. Here we make use of ... Read More

How to prohibit a Python module from calling other modules?

Rajendra Dharmkar
Published on 21-Dec-2017 11:46:16
You can use "Sandboxed Python". A "Sandboxed Python" would let you permit or forbid modules, limit execution slices, permit or deny network traffic, constrain filesystem access to a particular directory (floated as "/"), and so on. It is also referred to as RestrictedExecution. There are many ways to implement sandboxing ... Read More

What is the difference between jQuery.load() and jQuery.ajax() methods in jQuery?

Ricky Barnes
Published on 21-Dec-2017 11:43:21
jQuery ajax() methodThe jQuery.ajax( options ) method loads a remote page using an HTTP request. $.ajax() returns the XMLHttpRequest that it creates. In most cases you won't need that object to manipulate directly, but it is available if you need to abort the request manually.Here is the description of all ... Read More

Is it possible to use Python modules in Octave?

Rajendra Dharmkar
Published on 21-Dec-2017 11:42:03
There is no straightforward way to do this. But it is possible to run a Python program and parse the output. You can execute any shell command using the function system (cmd, flag). The second argument is optional. If it is present, the output of the command is returned by ... Read More

What is the difference between jQuery.load() and jQuery.get() methods in jQuery?

Ricky Barnes
Published on 21-Dec-2017 11:38:19
jQuery load() methodThe load( url, data, callback ) method loads data from the server and places the returned HTML into the matched element.Here is the description of all the parameters used by this method −url − A string containing the URL to which the request is sent.data − This optional parameter represents ... Read More

What is the difference between jQuery.post() and jQuery.get() methods in jQuery?

Ricky Barnes
Published on 21-Dec-2017 11:32:59
jQuery post() methodThe jQuery.post( url, [data], [callback], [type] ) method loads a page from the server using a POST HTTP request.Assuming we have following PHP content in result.php file, ExampleThe following is the code snippet showing the usage of this method −   <head>       <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> ... Read More

How we can copy Python modules from one system to another?

Rajendra Dharmkar
Published on 21-Dec-2017 11:29:43
If you have your own Python modules you want to copy, you can simply copy them and run on other systems with Python installed. If you want to copy installed modules, the best way is to install the same version of Python on the second system. Then run$ pip freeze ... Read More

What does jQuery.serialize() method do in jQuery?

Ricky Barnes
Published on 21-Dec-2017 11:26:14
The serialize() method serializes a set of input elements into a string of data. Let’s say we have the following PHP content in serialize.php file −<?php if( $_REQUEST["name"] ) {    $name = $_REQUEST['name'];    echo "Welcome ". $name;    $age = $_REQUEST['age'];    echo "<br />Your age : ... Read More
Advertisements