User FAQs

If you have a question, please send it to us.


1) What does HTML stand for ?
HyperText Markup Language


2) What does HTTPS stand for ?
HyperText Transfer Protocol Secure


3) What is a Single Page Application (SPA) ?
An SPA is a web site or application that has a single URL
When the page updates or changes the URL does not change.
Content is dynamically updated without needing to reload the whole page.


4) How can you prevent the default behaviour ?
In HTML, you can return false to prevent default behavior:
Notice the onclick is in all lowercase.

<a href="#" 
  onclick=' console.log("The link was clicked."); return false; '
/>

5) What is event.preventDefault
In React you must call preventDefault() explicitly.
This ensures there is no error. Used to suppress any browser specific errors.

function handleClick(event) { 
  event.preventDefault();
  console.log("The link was clicked.");
}

6) Elements vs Attributes ?



7) Can you give some examples of JQuery AJAX functions ?
$.get() - load data from the server using a HTTP GET request
$.post() - load data from the server using a HTTP POST request
$.ajax() - perform an asynchronous HTTP (Ajax) request
All these functions and methods use XMLHttpRequest under the hood.


8) Write code to create a promise object using JQuery ?
You can create a promise object by using the $.Deferred method.
There are a number of methods available on this Deferred object

resolve - 
resolvewith - passes data to the promises object subscribers
notify -
notifywith - passes data to the promises object subscribers
reject -
rejectwith - passes data to the promises object subscribers
promise -

There are a number of methods available on the Promise object

done - 
fail -
always -
pipe -
progress -
state -
then -

function timeoutAsync(milliseconds) { 
    var deferred = $.Deferred();
    setTimeout(function () { deferred.resolve(); }, milliseconds); // run this code when the time has expired
    return deferred.promise(); // changes the state of the promise object to resolved
};
function abcAsync() {
    var promise = timeoutAsync(2000);
    promise.done(function () { alert('done!') });
    return promise; // you should always return a promise
};


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext