Skip to main content

JAVASCRIPT Problems

Hello


Students check these javascript problems

  1. Add new elemts at the beginning of array
    <html >
    <body >
    <script language="javascript" >
    var scripts=new Array();
    scripts[0]="PHP";
    scripts[1]="ASP";
    scripts[2]="JAVASCRIPT";
    scripts[3]="HTML";
    document.write(scripts.join("< br > "));
    document.write("< br >---- NOW AFTER APPLYING unshift()---< br >");
    scripts.unshift("VBSCRIPT","PERL");
    document.write(scripts.join("< br >"));
    </script >
    </body >
    </html >

  2. Display Today's date and Time

    < html >
    < title >
    < /title >
    < body >
    < script language="javascript" >
    var d=new Date;
    document.write("< b > "+d);
    < /script >
    < /body >
    < /html >
  3. Add an element to position 2 in an array
    < html >
    < body >
    < script type="text/javascript" >
    var fruits = ["HTML", "JSP", "PHP", "ASP"];
    document.write("Removed: " + fruits.splice(2,0,"JAVASCRIPT") + "< br / >");
    document.write(fruits);
    < /script >
    < /body >
    < /html >

  4. Concatenate two arrays

    < html >
    < body >
    < h2 > concat arrays containig alphabets,numbers,symbols < /h2 >
    <script language="javascript" >
    var alphabets = ["a","b","c"];
    var numbers = ["1","2"];
    var symbols = ["@", "$","^"];
    var alphano = alphabets.concat(numbers,symbols);
    document.write(alphano);
    < /script >
    < /body >
    < /html >

  5. To concert today's date to string
    < html >
    < body >
    < script language="javascript" >
    var d =new Date();
    document.write("in original form");
    document.write(d +"< br/ > ");
    document.write("(according to UTC) to string:");
    document.write(d.toUTCString());
    < /script >
    < /body >
    < /html >

  6. TO remove first element of the array
    < html >
    < head >
    < title > Removing the first Element < /title >
    < script language="javascript" type="text/javascript" >
    < !--
    var x = new Array(1,2,3,4);
    var firstElement = x.shift();
    alert(firstElement);
    alert(2);
    alert(3);
    alert(4);
    alert(x);
    //-->
    < /script >
    < /head >
    < body >
    < h1 > Removing the first Element < /h1 >
    < /body >
    < /html >

  7. Replace character in a string
    < html>
    < body>
    < script language="javascript" >
    var str="LOGIN UR ID!";
    document.write(str.replace(/ID/,"ACCOUNT"));
    < /script >
    < /body >
    < /html >
  8. Reverse order of elements in the array
    < html >
    < title > JavaScript array reverse() example < /title >
    < body >
    < h2 >
    Example of reversing an array
    < /h2 >
    < script type="text/javascript" >
    var arr = new Array(3);
    arr[0]="1";
    arr[1]="2";
    arr[2]="3";
    document.write("< b > Array before reversed is < /b >="+arr+"< br > ");
    document.write("< b > Reversed array is < /b > ="+arr.reverse()+"<br > ");
    < /script >
    < /body >
    < /html >

compiled by PRAPTI

Comments

Popular posts from this blog

Inter-Organizational Value Chain

The value chain of   a company is part of over all value chain. The over all competitive advantage of an organization is not just dependent on the quality and efficiency of the company and quality of products but also upon the that of its suppliers and wholesalers and retailers it may use. The analysis of overall supply chain is called the value system. Different parts of the value chain 1.  Supplier     2.  Firm       3.   Channel 4 .   Buyer
Advantages and Disadvantages of EIS Advantages of EIS Easy for upper-level executives to use, extensive computer experience is not required in operations Provides timely delivery of company summary information Information that is provided is better understood Filters data for management Improves to tracking information Offers efficiency to decision makers Disadvantages of EIS System dependent Limited functionality, by design Information overload for some managers Benefits hard to quantify High implementation costs System may become slow, large, and hard to manage Need good internal processes for data management May lead to less reliable and less secure data

System Analysis and Design (SAD)

Introduction to System Analysis and Design (SAD) System are created to solve Problems. One can think of the systemsapproch as an organised way of dealing with a problem. In this dynamic world , the subject system analysis and design, mainly deals with the software development activities. This post include:- What is System? What are diffrent Phases of System Development Life Cycle? What are the component of system analysis? What are the component of system designing? What is System? A collection of components that work together to realize some objectives forms a system. Basically there are three major components in every system, namely input, processing and output. In a system the different components are connected with each other and they are interdependent. For example, human body represents a complete natural system. We are also bound by many national systems such as political system, economic system, educational system and so forth. The objective of the system demands tha...