[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

w3-javascript-url.el



Here is a simple  addition to W3 to allow one to jump to
javascript:mumble urls.
It's a hack but it works.
(defvar w3-javascript-cleanup-buffer " *javascript-cleanup*"
  "temporary scratch area")

(defun w3-javascript-follow-link ()
  "Follow URL hidden inside a javascript link"
  (interactive)
  (unless (eq major-mode 'w3-mode)
    (error "Not in a W3 buffer."))
  (let ((url (w3-view-this-url 'no-show))
        (buffer (get-buffer-create
                 w3-javascript-cleanup-buffer)))
    (save-excursion
      (set-buffer buffer)
      (erase-buffer)
      (insert url)
      (goto-char (point-min))
      (search-forward "('")
(delete-region (point-min) (point))
(goto-char (point-max))
(search-backward "'")
(delete-region (point) (point-max))
(w3-fetch 
(buffer-string)))))




(define-key w3-mode-map "\M-j" 'w3-javascript-follow-link)

-- 
Best Regards,
--raman

      
Email:  raman@xxxxxxxxxxx
WWW:    http://cs.cornell.edu/home/raman/             
PGP:    http://cs.cornell.edu/home/raman/raman.asc 

-----------------------------------------------------------------------------
       To unsubscribe or change your address send mail to
"emacspeak-request@xxxxxxxxxxx" with a subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe