15 maj 2008

Otworzenie strony w nowym oknie

function click_on(a) {
    window.open(a);
}
<a title="www" href="javascript:click_on('http://kody.wig.pl')">www</a>
20 kwi 2008

Wyrażenie regularne RegExp, zamiana znaków

Dim str
str = "aBbc"

Set objRegEx = New RegExp
objRegEx.Global = True
objRegEx.IgnoreCase = True
objRegEx.Pattern = "b"
str = objRegEx.Replace (str, "a")
MsgBox str
20 kwi 2008

Zapis stringa do pliku

Dim fso, stream, str, re, name
name = "page2.html"
Const ForWriting = 2, TristateUseDefault = -2
Set fso = CreateObject("Scripting.FileSystemObject")
 str = Replace(str, "–", "-")

'Set stream = fso.OpenTextFile("page_lot2.html",ForWriting, True ,TristateUseDefault)
stream.Write(str)
stream.Close
Set stream = Nothing