Difference between revisions of "Ns hrefs"

From AOLserver Wiki
Jump to navigation Jump to search
(Made the wiki not interpret the HTTP URLs in the example; removed the question about how to do that., indented like examples in ns_http)
(Missed a space in the indenting fix.)
 
Line 17: Line 17:
 
'''EXAMPLES'''
 
'''EXAMPLES'''
 
<pre><nowiki>
 
<pre><nowiki>
  % set html {One good website is <A href='http://google.com/'>Google</A>.
+
  % set html {One good website is <A href='http://google.com/'>Google</A>.
              Another is <a href='http://www.yahoo.com'>Yahoo!</a>}
+
              Another is <a href='http://www.yahoo.com'>Yahoo!</a>}
  
  % ns_hrefs $html
+
  % ns_hrefs $html
  http://google.com/ http://www.yahoo.com
+
  http://google.com/ http://www.yahoo.com
 
</nowiki></pre>
 
</nowiki></pre>
  

Latest revision as of 18:21, 8 February 2008

Man page: http://aolserver.com/docs/tcl/ns_hrefs.html


NAME

ns_hrefs - Returns URLs from anchor elements in a chunk of HTML

SYNOPSIS

ns_hrefs html

DESCRIPTION

This command finds the anchor elements (<A>) in a chunk of HTML, html, and returns a list of the URLs in those elements' href attributes.

EXAMPLES

  % set html {One good website is <A href='http://google.com/'>Google</A>.
              Another is <a href='http://www.yahoo.com'>Yahoo!</a>}

  % ns_hrefs $html
  http://google.com/ http://www.yahoo.com

Category Documentation - Category Core Tcl API