Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | Get the real size of a web page SEARCH    

MioFactory

  TechNotes
Adding a Login feature
Get the real size of a web page
How to create a Business Card
How to create a Desktop Alert
How to create a Desktop Ticker
How to create a Scrolling Alert Software
How to create a Scrolling Ticker
How to create a simple RSS Reader
How to debug
LCD Monitor Chart: Screen Resolution, Size, Pitch, Display Area
Managing read marks
Measuring Elements in JavaScript
Media center remote control
Statistics: How to track users and actions
XML Configuration File Format

  Help
01. Introduction
02. Creating an application
03. Application Settings
04. Manipulating Files
05. Editing Code
06. MioFactory Installer
07. Publishing Applications

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

  Products
All Products
MioDB
MioFactory
Mioplanet Admin Panel

TechNote
Get the real size of a web page

Language: MioScript
Product: MioFactory


The size of a web page displayed in a web browser component can be retreived with the small code provided here.

The size of the web page is not the same than the web browser component. A part of the page can be hidden, or the page can be smaller than the web browser object.

This script will help you if you need to create a custom scroll bar, or if you need to manipulate a bitmap copy of the web page with browser.ID.copyTo.ID.

How does it works



To retreive the size of the web page from MioScript, a loop is called 10 times per second to execute a JavaScript code on the web page.

This JavaScript code read the current size of the document (properties scrollWidth and scrollHeight of the body object).

Finaly, the JavaScript code call the MioScript function get_width_height with the size of the document as parameters.





MioScript Sample Code

event.load
    // Your code here
    
    doEvent.checkWebPageSize()
event.end

event.checkWebPageSize
    &exScript="window.setTimeout("str.comma("document.location='mio:get_width_height='+document.getElementsByTagName('body').item(0).scrollWidth+'^^'+document.getElementsByTagName('body').item(0).scrollHeight")",100)"
    browser.&wbr.execScript(&exScript)
    doEvent.checkWebPageSize(100)
event.end

function.public:get_width_height(&size[])
    &page_width = &size[0]
    &page_height = &size[1]
function.end