/    Sign up×
Community /Pin to ProfileBookmark

processed html

I am interested in getting the processed html source (after all scripts were processed).
For example if the html source contained this section

<script>
var query = window.location.search.substring(1);
var ListComp = getQueryVariable(“ListedComp”, query);
if(ListComp == null) {
ListComp=’All’;
}
var strurl = ‘/about/listed/lc_B.html?ListedComp=’+ListComp;
document.write (“<a href=”+strurl+”>B</a> &nbsp;”);
</script>

I want this to be replaced by what is actually in the document (just the <a> tag).

is anyone familiar with such a tool ?
it seems as if Gecko & MSHTML should be able to do this however i did not see any documentation regarding this.

thanks,
elewinso.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@felgallMay 08.2006 — Here is info about two scripts that can do it. One is a bookmarklet (runs from the bookmarks menu) and the other is a user script (attaches to the web page itself).

http://javascript.about.com/library/blsource.htm

http://javascript.about.com/library/blviewsource.htm
Copy linkTweet thisAlerts:
@elewinsoauthorMay 09.2006 — Thanks a lot. this was very helpful.

just a thought, i noticed that the result of executing the content of the <script> tag is appended right after the tag. is there a way to replace the <script> tag with the output instead of appending it.
×

Success!

Help @elewinso spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...