On Aug 28, 2007, at 11:12 PM, Sagari wrote:
Greetings,
The task: to add content (HTML) exactly at the place where <script>
was placed, i.e. how do I get the parent of a
<scrirpt type="text/javascript" src="scriptsource.js"></script>
-like tag?
I need to use DOM scripting, not document.write().
Thank you!
Konstantin
Hi Konstantin,
To add HTML content immediately following that script tag, you
wouldn't need to know the parent element. Instead, you could try
something like this:
$('[EMAIL PROTECTED]').after('<div>Your HTML</div>');
That particular example (using a div) would only work if the script
tag is in the <body>, though.
To find the parent of that script, you could do this:
$('[EMAIL PROTECTED]').parent();
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com