Who can delete the JavaScript in a .htm or .html file?
- Author
- Message
-
Offline
- Posts: 24
- Joined: Tue Nov 10, 2009 2:43 am
- Location: Beijing, China
- Contact:
Who can delete the JavaScript in a .htm or .html file?
The JavaScript inside a .htm file is quite awful, after saving a Webpage in my computer. I can delete the .js files in its folder. However, it is quite difficult to delete the JavaScript inside a .htm file, because its content is not fixed.
I can know that it always starts with:
<script
and ends with:
</script>
Akelpad can only replace fixed contents. Who can tell me how to use other tools to delete the JavaScript?
I can know that it always starts with:
<script
and ends with:
</script>
Akelpad can only replace fixed contents. Who can tell me how to use other tools to delete the JavaScript?
Last edited by akyahoo on Mon Jun 14, 2010 1:01 am, edited 2 times in total.
-
Offline
- Posts: 40
- Joined: Sat Sep 06, 2008 1:39 am
You can try something like Text Crawler, that uses regular expressions. One simpler tool that might work is Text Magician. Only use text Magician on copies! It can be a great help, though.
-
Offline
- Posts: 119
- Joined: Sat Jan 12, 2008 10:16 am
- Location: Shantou, China
Delete the JavaScript in a .htm or .html file
Run SearchReplace.js and Try
Replace:
With: (Empty this field)
Uncheck all CheckBox. Then click OK.
OK?
Replace:
Code: Select all
<script(.*\s)*?.*</script>
Code: Select all
OK?
-
Offline
- Posts: 24
- Joined: Tue Nov 10, 2009 2:43 am
- Location: Beijing, China
- Contact:
-
Offline
- Posts: 5
- Joined: Sat Aug 14, 2010 8:47 am
- Location: Saratov
Hi everyone , sorry , but SearchReplace.js seems doesn't work properly. It always workin' in a "greedy" style . May be I have an old version of a script ? And this construction doesn't work too :<script(.*\s)*?.*</script>
Offtopic:
And, besides, I wrote a script in PowerShell for adding to favorites (AP version 4.0.2,thus I think I'll do that in PS scripting language.
Offtopic:
And, besides, I wrote a script in PowerShell for adding to favorites (AP version 4.0.2,thus I think I'll do that in PS scripting language.
-
Offline
- Posts: 124
- Joined: Tue Jun 03, 2008 10:32 pm
SearchReplace.js works just fine, only the regexp was made lubberly. Use simpy
Code: Select all
<script.+?</script>
-
Offline
- Posts: 5
- Joined: Sat Aug 14, 2010 8:47 am
- Location: Saratov
Just installed a newer version of AP and SearchReplace.js . All is working just fine . Thanks a lot !! Finally it's working!!!.
And where is a COM Object like AkelPad.document has gone? I used to use them in some of my PowerShell script, though they worked halfway, but nevertheless it allowed to adress to the system API functions.
And where is a COM Object like AkelPad.document has gone? I used to use them in some of my PowerShell script, though they worked halfway, but nevertheless it allowed to adress to the system API functions.