homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

newbie probs: remove element and adding image links

5+ Year Member

Msg#: 3410963 posted 9:33 pm on Aug 1, 2007 (gmt 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.



WebmasterWorld Senior Member 10+ Year Member

Msg#: 3410963 posted 9:57 pm on Aug 1, 2007 (gmt 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].


5+ Year Member

Msg#: 3410963 posted 10:43 pm on Aug 1, 2007 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved