Thanks guys,
Brilliant stuff. Wish I asked for help earlier now. I'm using the following subroutine to fix the links. Whilst not 100% fool proof, it will try to ascertain when the page has finished loaded and fix the links once the html control ceases to be busy. It tries to take into account variable time periods that a page takes to load.
Techjunkie best of luck with your mission on the other Html Control - thread, looks really exciting and imaginative what you are doing!
(defun c:HtmlTest_HtmlTest_Html1_OnNavigationComplete (url / )
(HTMLCONTROL_LINKFIX HtmlTest_HtmlTest_Html1 2000 500)
(princ)
);endfun
;;subroutine to ascertain when a page has finished loading and then run Techjunkie's javascript trick to change the links
;reference
{2}
;;credits to Techjunkie for the genius javascript trick
;;arguements:
;;1. HtmlControl - the name of the ODCL HtmlControl eg HtmlTest_HtmlTest_Html1
;;2. MaxDelay - the maximum acceptable delay in milliseconds before the routine gives up eg 2000
;;3. TimeInterval - The intervals that the routine tries to correct the links with javascript (MaxDelay should be divisible by TimeInterval)
(defun HTMLCONTROL_LINKFIX (HtmlControl MaxDelay TimeInterval / TimeElapsed)
(setq TimeElapsed 0)
(while (< TimeElapsed MaxDelay)
(if (not (dcl_Html_GetBusy HtmlControl))
(progn;then
(dcl_Html_Navigate HtmlControl "javascript:(function(){var a=document.getElementsByTagName('a');for(var i=0;i<a.length;i++){a
.target='_top';}})();")
(setq TimeElapsed MaxDelay)
);endprogn
(progn;else
(vl-cmdf "_.delay" TimeInterval)
(setq TimeElapsed (+ TimeElapsed TimeInterval))
);endprogn
);endif
);endwhile
);endfun