Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6600211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:35:32+00:00 2026-05-25T18:35:32+00:00

I need to get the window height and width of the browser using ATK4,

  • 0

I need to get the window height and width of the browser using ATK4, the lightweight php framework with jquery

The javascript to get this would be

 $(window).height();
 $(window).width();

As agiletoolkit integrates with jquery, i think it should be possible to get it with something like

         $height=$p->js()->univ()->_selectorWindow()->height();

but this doesnt work, instead when i pass the $height variable to be used, in the HTML source i get the following .

 'height':$(window).univ().height(),'width':$(window).univ().width()

and it doesnt display the element at all

I want to be able to call jqplot to set the width of a graph to the full width of the users browser on a particular page. To do this, i need to pass a parameter which is width:NNN where NNN is the number of pixels wide. As far as i know, jqplot doesnt support a parameter as a percentage so i cant say width:100%. Also, if i set a div on the page and add the graph, it also ignores the size of the div and creates a small graph 400 x 300 pixels only.

I created a plugin to use jqplot from atk4 but this is one of the issues I still need to resolve. I can pass a height and width as parameters without issue but i want it to default to the full screen size if no parameters are specified.

Can anyone suggest the right syntax for getting these values ? TIA.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:35:33+00:00Added an answer on May 25, 2026 at 6:35 pm

    what you should understand is that “$p->js()->_selectorWindow()->height();” will actually be translated to “$(window).height();” — but you can get width of window ONLY at client side.

    so, if you want to get height of the window in your code, you can do that only by using ajax request, where actual heigh is sent back from the frontend.

    please, rephrase your question so that it’s clear what you need height for so I can suggest best way of doing that.


    example of how to get backend and frontend interlinked:

    paste this in page/test.php and open up http://example/test to see in action

    class page_test extends Page {
        function init(){
            parent::init();
    
            $b=$this->add("Button");
            $b->set("Get Width");
            $b->js("click")->univ()->ajaxec($this->api->getDestinationURL(), array("width" => $this->js(true)->_selectorWindow()->width()));
            $v=$this->add("View_HtmlElement")->setElement("div")->set("Click button to get width of the window");
            if ($w = $_POST["width"]){
                $v->js(null, $v->js()->html("Width: " . $w))->univ()->alert("Width: " . $w)->execute();
            }
        }
    }
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am needing to get the browser height and width of the browser window
I've been using this snippet of jQuery to get a sticky footer: if($(document.body).height() <
I need to get this Jquery box to appear on page load. Right now
I need to get the body element height and width, when i resize the
I can get window.document but how can I get document.window ? I need to
I need to get the Handler to the child Window of a certain application
I'm using Delphi and need to get the current Windows DNS server IP address
I need to get the default printer name. I'll be using C# but I
I can't understand why this doesn't work, or what I need to get it
I wrote a flex application that get the host string from the browser using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.