I have the following code which works fine for scraping a page
content.

$("#global").load("filePath .globalNews ul");

But after getting the content I would like to modify it. For example,
if the above code results in following HTML

<ul>
<li><A href="news1.html" target="_blank">News1</A>
<li><A href="news2.wmv" target="_blank">News2</A>
</ul>

What I really want after modification is (need to output this in the
element with id 'global')

<ul>
<li><A href="news1.html" target="_blank" onclick="myPopupFunction
();">News1</A> <A href="news1.html" target="_blank">New Window</A>
<li><A href="news2.wmv" target="_blank">News2</A>
</ul>

As you see, If the link is not a .wmv file, I would like to clone the
link and append to the original with a space in between (Also, the
link title needs to be changed to 'new window'). To the original link,
I would like to add an onclick event handler too (The task is to have
the link to open in a popup (we have a custom JS library) or in a
browser new window).

Reply via email to