DynAds Pro
| Sample Testimonial
|
Thank you very much for your extremely helpful and detailed reply.
I adapted your sample script and was able to achieve exactly what I was looking for.
Once again I am amazed at both the flexibility of your product and your incredible technical support!
Best Regards.
B. Brooks, BetterWhoIs.com
More...
|
|
Global Variables and Functions
These functions and variables are global and can be called/retrieved directly. They are
helper functions that isolate many browser specific tasks from the user.
windWidth: Width of the usable client area.
windHeight: Height of the usable client area.
docXScroll: The amount of horizontal scrolling.
docYScroll: The amount of vertical scrolling.
MouseX: Current horizontal position of the mouse pointer
MouseY: Current vertical position of the mouse pointer
mouseEventHandler: Retrieve the current position of
mouse pointer.
getObjByID: Find the object whose ID is given.
putContent: Change the html content of a given object.
parseCookie: Retrieve the cookies in an array as name-value pairs.
getCookieValue: Retrieve the value of the named cookie from
the cookie array.
deleteCookie: Deletes the named cookie from the document cookies.
parseCookieValue: Parses the packed value of a cookie.
| windWidth |
| Definition: |
Returns the width of the usable client area of the current window.
|
| Syntax: |
function windWidth()
|
| Arguments: |
None
|
| Returns: |
Usable window width in pixels.
|
| Remarks: |
Different browsers have different access methods. If a browser does not support any of the
known methods then a 750px is returned as a guess. Note that this is the width of the window
not the screen.
|
| Example: |
var wwidth = windWidth() ;
|
| windHeight |
| Definition: |
Returns the height of the usable client area of the current window.
|
| Syntax: |
function windHeight()
|
| Arguments: |
None
|
| Returns: |
Usable window height in pixels.
|
| Remarks: |
Different browsers have different access methods. If a browser does not support any of the
known methods then a 450px is returned as a guess. Note that this is the height of the window
not the screen.
|
| Example: |
var wheight = windHeight() ;
|
| docXScroll |
| Definition: |
Returns the the amount of horizontal scrolling in pixels.
|
| Syntax: |
function docXScroll()
|
| Arguments: |
None
|
| Returns: |
The horizontal scrolling amount in pixels.
|
| Remarks: |
Different browsers have different access methods. If a browser does not support any of
the known methods, a 0 is returned.
|
| Example: |
var xscroll = docXScroll() ;
|
| docYScroll |
| Definition: |
Returns the the amount of vertical scrolling in pixels.
|
| Syntax: |
function docYScroll()
|
| Arguments: |
None
|
| Returns: |
The vertical scrolling amount in pixels.
|
| Remarks: |
Different browsers have different access methods. If a browser does not support any of
the known methods, a 0 is returned.
|
| Example: |
var yscroll = docYScroll() ;
|
| MouseX |
| Definition: |
A global variable which holds the current horizontal position of the mouse pointer.
|
| Syntax: |
var MouseX ;
|
| Remarks: |
MouseX variable is set by mouseEventHandler function. Do NOT assign to this variable.
|
| MouseY |
| Definition: |
A global variable which holds the current vertical position of the mouse pointer.
|
| Syntax: |
var MouseY ;
|
| Remarks: |
MouseY variable is set by mouseEventHandler function. Do NOT assign to this variable.
|
| mouseEventHandler |
| Definition: |
Retrieves the current position of mouse pointer and sets MouseX and MouseY variables.
|
| Syntax: |
function mouseEventHandler (ev)
|
| Arguments: |
ev : Event object passed.
|
| Returns: |
None.
|
| Remarks: |
Handles different access methods of different browsers. This function must be called by an
event method of the browser directly or indirectly. DAG API automatically assigns this
function to an appropriate event handler by creating a new Global Event Handler (GEH) object
so that MouseX and MouseY always contains the position of the mouse pointer.
|
| getObjByID |
| Definition: |
Finds and returns the object whose ID is given.
|
| Syntax: |
function getObjByID(divID, layID)
|
| Arguments: |
divID : ID or NAME of the html tag on the browser.
layID : NAME of Netscape LAYER tag, provided for limited support for old Netscape browsers.
|
| Returns: |
The object found on the browser.
|
| Remarks: |
Different browsers have different access methods. The function supports all known methods to
cover all browsers.
|
| Example: |
1)
<LAYER NAME="layer1">
<DIV ID="div1">
Content of layers
</div></layer>
<SCRIPT >
var obj = getObjByID("div1", "layer1") ;
putContent(obj, "New Content of Layers") ;
...
</script>
2)
<A ID="Test" HREF="index.html">Click Here</a>
<SCRIPT >
var obj = getObjByID("Test", "") ;
obj.href = "anotherindex.html" ;
...
</script>
|
| putContent |
| Definition: |
Changes the html content of given object.
|
| Syntax: |
function putContent(obj, cont)
|
| Arguments: |
obj : Object retrieved by getObjByID previously.
cont : New html content.
|
| Returns: |
None.
|
| Remarks: |
Supports both regular block level tags and Netscape LAYER tags.
|
| Example: |
<LAYER NAME="layer1">
<DIV ID="div1">
Content of layers
</div></layer>
<SCRIPT >
var obj = getObjByID("div1", "layer1") ;
putContent(obj, "New Content of Layers") ;
...
</script>
|
| parseCookie |
| Definition: |
Retrieves the cookies in an array as name-value pairs.
|
| Syntax: |
function parseCookie()
|
| Arguments: |
None.
|
| Returns: |
An array of cookies reported by the browser. If the returned array is named acookie, then
acookie.length is the number of cookies, acookie[i][0] is the name of ith cookie
and acookie[i][1] is the value of ith cookie.
|
| Remarks: |
Browsers only reports to JavaScript the cookies set for the path "/".
|
| Example: |
var acookie = parseCookie() ;
document.write("Currently "+ acookie.length + " cookies are set.<BR>") ;
for (var i =0 ; i < acookie.length ; ++i) {
document.write(acookie[i][0] + " : " + acookie[i][1] + "<BR>") ;
}
|
| getCookieValue |
| Definition: |
Retrieves the value of the named cookie from the document cookies.
|
| Syntax: |
function getCookieValue(cname)
|
| Arguments: |
cname: Name of the cookie whose value is searched.
|
| Returns: |
Finds the given named cookie and returns its value. If the named cookie is not found,
then a null is returned. The returned cookie value is NOT unescaped!
|
| Example: |
var value = getCookieValue("MyFirstCookie") ;
if (value) {
document.write("MyFirstCookie is " + unescape(value)) ;
}else {
document.write("MyFirstCookie is NOT set") ;
}
|
| deleteCookie |
| Definition: |
Deletes the named cookie from the document cookies.
|
| Syntax: |
function deleteCookie(cname)
|
| Arguments: |
cname: Name of the cookie to be deleted.
|
| Returns: |
None.
|
| Example: |
var value = getCookieValue("MyFirstCookie") ;
deleteCookie("MyFirstCookie") ;
if (value) {
document.write("MyFirstCookie is " + unescape(value)) ;
}else {
document.write("MyFirstCookie is NOT set") ;
}
|
| parseCookieValue |
| Definition: |
Parses the packed value of the cookie further.
|
| Syntax: |
function parseCookieValue(value)
|
| Arguments: |
value: Unescaped value of the cookie.
|
| Returns: |
Array of values obtained by parsing the value argument into segments seperated by '&'.
The return values are escaped.
|
| Remarks: |
This function is used to extract packed cookie contents. The content is packed by appending
values by the character '&'. Each retrieved content is unescaped an put in to the
returned array in sequence.
|
| Example: |
var value = getCookieValue("MyFirstCookie") ;
var pvals = parseCookieValue(value) ;
document.write ("Packed values of MyFirstCookie are: <BR>") ;
for (var i =0 ; i < pvals.length ; ++i) {
document.write(pvals[i] + "<BR>") ;
}
|
|
|