I meant to send this to the links group rather than myself :-)
----- Forwarded message from [EMAIL PROTECTED] -----
Date: Thu, 04 Oct 2007 18:39:11 +0100
From: Tom Andersson <[EMAIL PROTECTED]>
Reply-To: Tom Andersson <[EMAIL PROTECTED]>
Subject: Re: [links-users] Accessing DOM's Document Object
To: Tom Andersson <[EMAIL PROTECTED]>
Tom Andersson wrote:
Hi all,
I'm trying to access the DOM's document object
(http://www.w3schools.com/htmldom/dom_obj_document.asp) i.e. like
javascript's window.document, and the only possibly suitable Links
method that looks similar is getDocumentNode. Unfortunately, this
appears to only return the top-level node of the document, i.e.
<html>. Is this the expected behaviour?
Thanks,
Tom
_______________________________________________
links-users mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/links-users
Having rethought the issue, window.document probably doesn't count as a
a node, so the above makes sense. It would, however, be nice to be able
to access the window.document attributes, or perhaps even the window
object itself? For now, I've written the following function to sort it out.
In jslib.js:
function _domSetWinDocAttribute(attr, value) {
return window.document[$str(attr)] = $str(value);
}
var domSetWinDocAttribute = LINKS.kify(_domSetWinDocAttribute, 2);
In library.ml:
"domSetWinDocAttribute",
(`Client, datatype "(String, String) -> String",
IMPURE);
/Tom
----- End forwarded message -----
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
links-users mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/links-users