How to get the current url in php
$_SERVER , print this variable and get the details regarding url. $_SERVER[‘REQUEST_URI’] will provide the current page url
What are javascript functions?
Functions are block of code enclosed with braces as in other programming language. In javascript functions are called first level object. Because all elements are treating as a object in javascript.
How to use an array of values in javacript?
As usual arrays we can add values into an array variable using commas as separator along with other properties. function myobjs(){ this.name= “john”; //Property this.age= “20”; //Property this.nickname=[“a”,”b”,”c”]; //Array this.allname=function(){ // array values using in function this.nickname.forEach(function(eachname){ console.log(eachname); }); } } var insta_myobj=new myobjs(); insta_myobj.allname();
What are the methods to access javascript properties and methods?
we can use dot and brackets to access the properties and methods. function myobjs(){ this.name= “john”; //Property this.age= “20”; //Property this.nameandage= function(){ // Method console.log(this.name+’with age’+this.age); }, this.nickname=[“a”,”b”,”c”]; // using multiple values to a property , like array this.allname=function(){ alert(“eachname”); this.nickname.forEach(function(eachname){ alert(eachname); }); } } var insta_myobj=new myobjs(); alert(insta_myobj[‘name’]); // brackets insta_myobj.allname(); // dot…
How to access declared objects in javascript ( object instances )
Object instance need to access properties and methods of an object. When we used constructor method to define objects, we need to create an instance of the object to use the properties and methods of that object. function myobj(){ this.name= “joe”; //Property this.age= “20”; //Property this.nameandage= function(){ // Method console.log(this.name+’with age’+this.age); } } …
Whats are properties and methods used in javascript?
Properties are variables used in javascrips. Methods are functions used in javascrips. Both are used inside an object. var myobj={ name : “joe”, //Property age : “20”, //Property nameandage: function(){ // Method console.log(this.name+’with age’+this.age); } }
Objects in javascripts?
Objects are building blocks of javasript. “Class” keyword not using in javascript. Its all about objects. All components in javascripts are objects, Strings, functions etc.. Loaded window of js(html page) also consider as an object, it is called “winodw object” or global object. declaration of object: Two methods are there: 1.var myobj={ fname:”joe”,//Property lname:”john”,//Property fullname:…
How to declare an object in javascript?
How to declare classes in jaascript? Objects are building blocks of javasript. “Class” keyword not using in javascript. Its all about objects. Two methods are there: literal object. 1.var myobj={ fname:”joe”,//Property lname:”john”,//Property fullname: function (){ console.log(this.fname +” ” + this.lname); } } we can access the properties through the methods used inside the objects, couldn’t…
Object Oriented Concept in javascrips?
Object oriented always used to refer about objects. Programming based on objects( actually a building block of javascript). All javascript components are objects. Eg: strings, functions etc… A set of codes enclosed in a block, usually we call it as a class. Object always refer to this class. What properties of Oop javascript used to…
display none using javascript
Either we can use show() and hide() functions for this: $(“#hide_id”).hide(); $(“#hide_id”).show(); Or using css in scripts: $(“#hide_id”).css(“display”, “none”); this id can be displayed using: $(“#hide_id”).css(“display”, “block”);