Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

newbie probs: remove element and adding image links

9:33 pm on Aug 1, 2007 (gmt 0)

New User

5+ Year Member

joined:Aug 1, 2007
votes: 0


really hope you can help. I'm trying to adapt the site favorites supercookie code from www.siteexperts.com/tips/xml/ts05/page1.asp . I'm trying create a gallery lightbox, storing local links to favorite images in a web gallery, without php/asp. But being new to xml/coding, I'm really struggling :( I need to be able to delete an element from the list generated. Just can't figure out how after hours. The code is

SITEINFO\:FAVORITES {behavior:url('#default#userData')"}
<SITEINFO:FAVORITES ID="siteFavorites"/>

function AddFavorite(sURL, sTitle) {
var oXMLDoc=siteFavorites.XMLDocument;
var oNode=oXMLDoc.createNode(1,"SITEINFO", "");
var oURLNode=oXMLDoc.createNode(1,"URL", "");
var oTitleNode=oXMLDoc.createNode(1,"TITLE", "");
oTitleNode.text = sTitle
oXMLDoc.documentElement.insertBefore(oNode, null);

function ListFavorites() {
var oXMLDoc = siteFavorites.XMLDocument.documentElement
var wList = window.open("","fav","width=300,height=200,top=0,left=0,scrollbars=yes")
wList.document.write("<TITLE> Favorite List</TITLE>")
wList.document.write("<BASE TARGET=\"_blank\">")

for (var i=0;i<oXMLDoc.childNodes.length;i++) {
with (wList.document) {
write("<A HREF=\"" + oXMLDoc.childNodes[i].childNodes[0].text + "\">")




<TD WIDTH=5></TD><TD valign=top ID=article><P class=start STYLE='text-align: left'>&nbsp;</P>

<INPUT TYPE=button VALUE="ex1" ONCLICK='AddFavorite("http://www.blank.co.uk/forexample1","example site1")'>
<BR><INPUT TYPE=button VALUE="ex2" ONCLICK='AddFavorite("http://www.blank.co.uk/forexample2","example site2")'>
<BR><INPUT TYPE=button VALUE="ex3" ONCLICK='AddFavorite("http://www.blank.co.uk/forexample3","example site3")'>

<BR><INPUT TYPE=button VALUE="List Favorites" ONCLICK="ListFavorites()">



If anyone also knows how to make the generated hyperlinks images that link to urls, that'd really make my month :). But either way, any help or hints hugely appreciated. Thanks very much.

9:57 pm on Aug 1, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
posts: 1526
votes: 0

Boy, I haven't a clue, but that's not because I don't know enough about XML, it's because this seems to be a JavaScript problem, and one that is related specifically to the XML parser system that you're using. I've never used it (I always use PHP or the native JS DOM tools).

You may want to try posting this in the J&A Forum [webmasterworld.com].

10:43 pm on Aug 1, 2007 (gmt 0)

New User

5+ Year Member

joined:Aug 1, 2007
votes: 0

thanks, I guess it is partly javascript - though i figured the problem was as much my grasp of the xml/dom side of things ie how actually get the (javascript) synatx right for the xml. I may try reposting in the javascript forum. thanks again.