Hello, I have a parenscript question, not really relating to UCW. What I want to do is include some literal javascript into a block of parenscript code. The goal is to keep this deliverable to a single html file, so including a .js file isnt really an option. Here's an example of what I want to do, using a fictional JS:LITERAL-JS function to inject the javascript.
<br><br>(js:js-script<br> <br> (js:literal-js "function getElementPosition(elemID) {<br> var offsetTrail = document.getElementById(elemID);<br> var offsetLeft = 0;<br> var offsetTop = 0;<br> while (offsetTrail) {
<br> offsetLeft += offsetTrail.offsetLeft;<br> offsetTop += offsetTrail.offsetTop;<br> offsetTrail = offsetTrail.offsetParent;<br> }<br> if (navigator.userAgent.indexOf(\"Mac\") != -1 &&
<br> typeof document.body.leftMargin != \"undefined\") {<br> offsetLeft += document.body.leftMargin;<br> offsetTop += document.body.topMargin;<br> }<br> return {left:offsetLeft, top:offsetTop};
<br>}")<br><br> (defun my-fun1 ()<br> ;; ...<br> )<br><br> (defun my-fun2 ()<br> ;; ...<br> ))<br><br>I could always convert the javascript code to parenscript code, but that could be time consuming and I'm lazy in my old age. I dont know enough about extending parenscript to figure this out. There must be an easy way to do this, any ideas?
<br><br>Thanks in advance,<br><br>Anthony<br>