Home PHP Ajax Regex Interviews Contact us    

PHP


Interview Questions



.Net | PHP | Mysql | Java script

Javascript interview questions
  1. How do you convert the string value into number in JavaScript?

    Use the parseInt() function

  2. What does isNaN function do?

    Return true if the argument is not a number.

  3. How do you create a new object in JavaScript?

    var obj = new Object();

  4. How do I clear a form after the user submits it?

    use reset()

    Eg:- document.forms[0].reset();

  5. How do I open the browser window with JavaScript?

    use window.open();

  6. How do I close the browser window with JavaScript?

    use window.close();

  7. How do I maximize the browser window in JavaScript?

    window.moveTo(x,y) - Coordinates on the screen are counted from left to right and from top to bottom, and the horizontal coordinate is given first.

    AND

    window.resizeTo(screen.width, screen.height); - screen.width and screen.height are built-in properties of the browser's screen object, which tell us how wide and tall the screen is. By calling the built-in function window.resizeTo with these values, we resize the browser to fill the screen.

  8. How do I close the browser window with JavaScript?

    use window.close();

  9. How do I set the user's home page with JavaScript?

    document.setHomePage("http://www.mysite.com");

  10. How do I generate a random number with JavaScript?

    use Math.floor()

    Eg:- var randomnumber=Math.floor(Math.random()*11)

  11. How to I access images using JavaScript?

    document.images[0] - will get first image

    Eg: - <img name="imagename" src="iamgename.gif" > To access this image,
    document.images["imagename"]
    OR
    document.images.imagename



Feed Back of this Topic
 
Name :
Email :
Topic :
Comments :

Ajax


Regular Expression


 
Copyright © 2007 123developers.com
Contact us | Disclaimer