A
ASM
Me a écrit :
the content of givent text file must be a string too
file myFile.txt :
myText = 'here is some words to tell you nothing';
html file :
<html>
<script type="text/javascript" src="myFile.txt"></script>
<script type="text/javascript">
str1 = 'aaaa';
str2 = 'bbbb';
str3 = 'cccc';
function preAdd(original, added) {
return added + original;
}
function postAdd(original, added) {
return original + added;
}
</script>
<p><a href="javascript:alert(preAdd(str1, str2))">Add str2 before str1</a>
<p><a href="javascript:alert(postAdd(str1, str2))">Add str2 after str1</a>
<p><a href="javascript:alert(preAdd(postAdd(str1, str2), str3))">
Add str2 after str1 and str3 before
</a>
<p>
<a href="javascript:alert(
preAdd(postAdd(myText,' at all'),'Hello ! ')
)">
Add "at all" after "my text" and "Hello !" before
</a>
</html>
how can you add a string aaaaaa at the beginning of a given string
"string" and bbbbb at the end of it especially recursively ifthere are
multiple "string"'s in a given text file ?
the content of givent text file must be a string too
file myFile.txt :
myText = 'here is some words to tell you nothing';
html file :
<html>
<script type="text/javascript" src="myFile.txt"></script>
<script type="text/javascript">
str1 = 'aaaa';
str2 = 'bbbb';
str3 = 'cccc';
function preAdd(original, added) {
return added + original;
}
function postAdd(original, added) {
return original + added;
}
</script>
<p><a href="javascript:alert(preAdd(str1, str2))">Add str2 before str1</a>
<p><a href="javascript:alert(postAdd(str1, str2))">Add str2 after str1</a>
<p><a href="javascript:alert(preAdd(postAdd(str1, str2), str3))">
Add str2 after str1 and str3 before
</a>
<p>
<a href="javascript:alert(
preAdd(postAdd(myText,' at all'),'Hello ! ')
)">
Add "at all" after "my text" and "Hello !" before
</a>
</html>