logo
WXT, a Web and Xml Tool
from Ostfold College
: Introduction > Documentation > The PIs >Popup

PI: popup

The purpose is to make a html-fragment that generates a popup-page and replace the PI with this fragment. It involves a javascript function, see below.

<?_wxt popup uri="" text="" title="" style="" image=""?>

The parameters are:

uri (mandatory) The URI of the page to show. This URI should be absolute (http://) or should be a correct relative URI. The only correction done is correction according to commons (commons)
text (optional) The text we want to show to identify the popup. Default is the URI.
title (optional) Works as title in HTML-hrefs. Default is 'popup'.
style (optional) The CSS-style we want to use on the popup-element. Default is no style.
image (optional) An image that we want to represent the popup-element. Will override text. The image-uri should be absolute (http://) or should be a correct relative URI. The only correction done is correction according to commons (commons

NOTE that this mechanisme relies of the existence of a javascript function called 'simplepopup'. This function is part of a very simple JavaScript-library which is available at: http://www.ia.hiof.no/~borres/common/jscripts/std.js.

You may as well write your own. It should take three parameters as should be clear from the sample definition below (which you could copy and work on):

function simplepopup(url,wname,wstyle)
  {
  	if(wstyle=='*')
  		wstyle='scrollbars=yes,resizable=yes,width=600,height=600,status=0';
  	try{
  		newwindow=window.open(url, wname, wstyle);
  		if (window.focus) {newwindow.focus()}
  	}
  	catch(E){
  		alert('If you have blocked pop-ups on this page\n Press Ctrl-key when clicking');
	  }
  }

Or you may copy the javascript library at AJAX

Some examples:

<?_wxt popup uri="content/pop.html"?>

<?_wxt popup text="Click" title="En enkel popup" uri="content/pop.html" style="popup"?>

<?_wxt popup uri="content/pop.html" image="gfx/home.gif"?>

WXT, a Web and Xml Tool from Ostfold College: http://www.ia.hiof.no/~borres/wxtdoc/


Bygget med WXT : 11.jan.2009