## DFrame: setURL

## DFrame: getURL

## DFrame: alert

## DFrame: addAlert

## DFrame: refresh

DFrame: addAlert

setURL method: Create the graphical representation of the DFrame object if not yet done and insert in it a HTML page.

getURL method: Return the url of the DFrame, if exists.

alert method: Create the graphical representation of the DFrame object if not yet done and send a text to the DFrame.

addAlert: Add a text to the previous one sent with alert or addAlert methods.

refresh: Reloads the curent URL

Example

var dFrame = new DFrame(parameters)
dFrame.setURL(url)

Demo

setURL: file: setTarget.html

Run the example
See the source code

alert: file: alert.html

Run the example
See the source code

### Syntaxes

DFrame.setURL(url[, visible[, alwaysRefresh])

DFrame.getURL()

DFrame.alert(text)

DFrame.addAlert(text)

DFrame.refresh()

### Parameters

url

setURL method. The url of the page to be inserted in the DFrame.

visible

setURL method. Boolean:
true: show the object
false: hide the object

alwaysRefresh

setURL method. Boolean:
When an url is set to a DFrame having the same url the only effect is to set it on top of the screen. If alwaysRefresh is set to true the url is reloaded.

It seems that Netscape 6 compares the current url with the new one and does nothing if they are the same.

text

alert and addAlert methods. String. The text to be sent to the DFrame

### Return value

setURL, alert and addAlert methods: No return value.

getURL method: String. The url of the DFrame.

### Usage

§ Caution: The page will only open with Netscape 6 if the body of the document inserted in the DFrame has a not null size. It must at least contains a space (&nbsp;) or a <br> tag.

§ If a DFrame is relative to another, either because of dimensions or because the other one is its parent the other DFrame is also created but is hidden.

Example

var dFrame1 = new DFrame(parameters);
var dFrame2 = new DFrame(position, title, dFrameStyle, dFrame1);
dFrame2.setURL(url);

will also create dFrame1.

In the same way,

var dFrame1 = new DFrame(parameters);
var position = [0, 0, 100, 100];
position[0] = [dFrame1, 'Right', 0];
var dFrame2 = new DFrame(position, title, dFrameStyle, someDFrame);
dFrame2.setURL(url);

will create dFrame1

§ The setUrl method is buffered. That means that the instruction is sent to a buffer whose role is to run sequentially the instructions. As it can take some time for a page to be loaded in a DFrame the onLoadDFrame function has sometime to be used:

var dFrame = new DFrame(parameters)

dFrame.setURL(someURLwithAForm)

alert(dFrame.window.document.forms[0].name)

will generate an error as the document inserted in dFrame is not yet loaded when it is accessed.

The correct method is:

In mainPage:

var dFrame = new DFrame(parameters)

In the page inserted in the dFrame:

function onLoadDframe() {

alert(thisDFrame.window.document.forms[0].name)

}