[turboid] javascript solutions

Home     Contact     Search     About me
GUI
11 Apr 2012

Window techniques and Display Area Features

For example: Finally bypass pop-up blockers

Here we go again with new features enhancing JavaScript, and this time they enhance it in terms of window and techniques and display area features.

One of the coolest things is the possibility of opening customizable windows inside the current document, leaving no chance for pop-up blockers. But, with Turboid, even new browser windows provide a kind of bypassing those annoying pop-up blockers. Besides of this, you can now open a new browser window in which your HTML code will directly be injected.

In order to use the following extra functions, simply download the free Turboid framework and put it into the directory of your HTML file, then write this line into the head section of your HTML file, and that's it:

	


Window.write(title, htmContent [, x, y, w, h])

Writes an arbitrary HTML code (htmContent) into a customizable window, which is an embedded part of the document (not a separate browser window). Passing coordinates and width and height values is optional. - Please pay attention to the fact that the first letter in Window must be upper case and has nothing to do with the standard JavaScript window object. [Please click here for further documentation]


Window.load(url, title [, x, y, w, h])

Loads an external website into a customizable window, which will be embedded in the document (not a separate browser window). Passing coordinates and width and height values is optional. Perfect for bypassing pop-up blocking tools. - Please pay attention to the fact that the first letter in Window must be upper case and has nothing to do with the standard JavaScript window object. [Please click here for further documentation]


Window.outside.load(url,x,y,w,h [, winName])

Opens a new separate browser window. The window will be opened, even if there is already another opened window, or if this function is called from another new window. Reusing this function closes the previously opened window, replacing it by a new one. However, the window object will be saved in Window.outside. In Window.outside.onready you can save a function which will automatically be called as soon as the new window has been opened.

Cool feature: This function bypasses pop-up blocking tools by allowing the user to open the new window by clicking on a button once or even simply by typing the return key. This is very useful since many browsers and blocking tools don't allow opening a new browser window by merely typing a key. But here you can define that the user can open the new browser window by typing a key of your choice, then he will only have to confirm this by typing the return key before the window gets really opened.

If you don't wish the intermediate step, the function would have to be called through a mouse event function (e.g onclick). Calling the Window.outside.load function merely from the "href" attribute of a link is not sufficient to avoid the intermediate step!

Please pay attention to the fact that the first letter in Window must be upper case and has nothing to do with the standard JavaScript window object.


Window.outside.inject(code, x, y, w, h [, isChild])

Opens a new browser window in which your HTML code will directly be injected. The truth value isChild is not obligatory. If it is set "true" the new window adopts the styles and scripts of the main window which the new one has been opened from. - Please pay attention to the fact that the first letter in Window must be upper case and has nothing to do with the standard JavaScript window object.


document.getX()

Returns the distance between the left viewport border and the left screen border.


document.getY()

Returns the distance between the top viewport border and the top screen border.


document.getWidth()

Since window.innerWidth has cross-browser compatibility problems, using this function is the right alternative. Returns the width of the current viewport. Works in IE 7 an 8, but only if the mouse pointer already has touched the viewport area before.


document.getHeight()

Since window.innerWidth has cross-browser compatibility problems, using this function is the right alternative. Returns the height of the current viewport. Works in IE 7 an 8, but only if the mouse pointer already has touched the viewport area before.


Comments

Add comment:

Name: (required)
E-Mail: (required, remains invisible)
Website:
Comment:
Please check all (anti-spam):