Follows a bookmarklet that will a page's generated source (that is: the
source including script tags and anything the script may have contibuted to
the page) in a new window which has
1. a textarea where you can edit the code
2. an button "Apply" that overwrites the page with your edited version.
3. a "Restore" button that will attempt to, eh, restore the old page.
This the code (bookmarklet code should be all on one line):
javascript:na=open('','edit','top=20,width=650,height='+(screen.availHeight-
99)+',directories,menubar,resizable');d7c=document.documentElement.innerHTML
;d7o=d7c;while(d7c.indexOf('<')>-1)d7c=d7c.replace('<','<');na.document.w
rite('<html><head><title>Sourcedit
"'+document.title+'"</title><style>body{margin:0px;border:0px;font:m
essagebox;background:AppWorkspace}input{font:messagebox;width:60;}textarea{w
idth:100%;}</style><script>d7o=opener.d7o;onresize=r;onload=r;function
r(){f.ta.style.height=document.body.clientHeight-f.ta.offsetTop-1}</script><
/head><body><form name=f><input type=button value=Apply
onclick="opener.document.open();opener.document.write(f.ta.value);opener.doc
ument.close();opener.focus()"><input type=button value=Restore
onclick="f.ta.value=d7o;f.ta.focus()"> Sourcedit <a
href="'+location.href+'">...'+location.href.substring(location.href.length-4
0)+'</a> ('+(b=d7o.split('\n').length)+' lines,
'+Math.round(d7o.length/b*10)/10+' cpl)<br><textarea
id=ta>'+d7c+'</textarea></form></body></html>');na.document.close();na.docum
ent.f.ta.focus();
Follows a bookmarklet that will prompt for a javascript expression. For
example if you know a page uses a global variable called "myVar", simply
type myVar in the prompt and the current value will be returned. Or if you
wish to change a function called "myFunc", enter function myFunc(){/* new
code */} and myFunc will behave in the new way from then on.
This is the code:
javascript:function JSexe(){ if (valJS!='null' &&
valJS!='undefined')strJS=valJS; strJS=prompt('Your JavaScript code or
variable:',strJS); if (strJS!=null && strJS!='' && strJS!='undefined'){
setTimeout('valJS=\'\'+eval(strJS);JSexe()',10); }
else{valJS='';strJS='';}}valJS='';strJS='';JSexe();
HTH
Ivo
www.4umi.com/web/bookmarklet