oops... wow that's much easier than what I figured out. (silly me! : )

The following code in my free nodelet loaded and executed code from my scratchpad:

<h5>embeddingtest</h5> <!-- <script> function evalFrame(iframe) { var html =iframe.contentDocument.body.innerHTML; html=html.replace(/^<pre>/,""); html=html.replace(/<\/pre>$/,""); eval(html) } </script> <iframe name="embed" height=30 width=150 onload="evalFrame(this)" styl +e="display:none" src="index.pl?abspart=1;displaytype=displaycode;node +_id=708739;viewmode=public;part=1"></iframe>

(my example code changes the title of the window, without stopping the build up of the page like alert() does)

just some notes:

1. With my method I needed to truncate some html-code, now I realize that it's the browser who inserted this code by itself.
2. "viewmode=public;" was necessary for me because sometimes the server choosed my private scratchpad instead.
3. The extra request slows down the browser and server.
4. IMHO you don't need jQuery for XmlHttpRequests, why do you think so?

Why do you consider sharing JS-code as a risk? An intruder can only manipulate pages within the perlmonks sandbox not my online banking. IMHO using opensource software is a much higher risk...

Cheers Rolf


In reply to Re^2: Sharing JS-Code on perlmonks.org by LanX
in thread Sharing JS-Code on perlmonks.org by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.