I'm trying to make a page where a user may enter a url into an input box, click submit, and the script will return the WebCite page. (WebCite is a url caching service. For example, if I "archive" www.google.com, the archive page is www.webcitation.org/65YgIgei6.) So WebCite has a query syntax that when given a url to cache, an email, and the parameter &returnxml=true
, it will return an xml file. (For example, http://www.webcitation.org/archive?url=http://www.google.com&[email protected]&returnxml=true leads to an xml file where the text between the <webcite_url>
tags is the archive page.)
So I would like some Javscript (or jquery) that will search the xml file for "<webcite_url>
" and "</webcite_url>
" and return the url within those tags. http://jsfiddle.net/gxHWk/ is the basic idea.
btw, I read stackoverflow.com/questions/6648454/search-and-output-data-from-an-xml-file-using-javascript, but I can't figure out how to adapt the code there to my circumstances.
(*removed "http://" from some links because of spam filter)
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…