Skip to main content

Posts

Showing posts with the label Create the Namespace in JavaScript

How To open URL in new tab in JavaScript?

JavaScript Open URL in New Tab - The “window.open()” function is used to open the URL tab in JavaScript. Example- window . open ( 'http://code-sample.com/' , '_blank' ); ü   Stayed Informed –   Object Oriented JavaScript Interview Questions I hope you are enjoying with this post! Please share with you friends!! Thank you!!!

How To Create the Namespace in JavaScript?

Create the Namespace in JavaScript- You can see the below example in Detail- //AJAX Synchronous and Asynchronous Requests. //#REGION NAMESPACE var demo = demo || {}; //#ENDREGION demo . ajax = demo . ajax || ( function () {     var getBaseURL = function () {         var currentBaseURL = location . protocol + "//" + location . hostname +             ( location . port && ":" + location . port ) + "/" ;         return currentBaseURL ;     };     var baseURL = getBaseURL ();     var request_token ;     var ajaxAsyncCall = function ( requestURL , typeGP , inputs , request_token ) {         //Ajax Async CALL         $ . ajax ({    ...