Hi Screen Resolution

[b][red]This message was edited by lovelyjob at 2005-12-31 13:16:51[/red][/b][hr]

I would like to set up screen resolution in java script for my website.
I would like to know more about Onload() function.

1) Will the logic implemented inside the onLoad() function will be
automatically invoked without even calling that function.

2) Can we embedded pieces of Java code in javascript not rather than applets in a web page.



  • If by "set up resoution" you mean the user's window's resolution the answer is no - of course.

    If you mean the size in pixels of the browser window, then the answer is yes, use: window.resizeTo(width, height). But I strongly advise you not to use it, as it will annoy people to have their browser resolution changed. I know I get annoyed.

    The onload event will automatically be called when the webpage has finished loading. Use it like this:


    function init() {


    And take a look at this page:
    The [blue]DHTML reference[/blue] -> [blue]DHTML events[/blue] link is what you need.

    As javascript has nothing to do with java although they are syntactically very similar, you cannot embed java in any other way than in an applet.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion