Utklippstavle

Legg inn en helt ny kode

Valgmuligheter

dabear sendte inn denne javascript-koden 13.08.2007 kl. 18:57.

<html>
<head>
<script type="text/javascript">
window.onload = function() {
    var elm = document.getElementById('spam')
    var regex = /((f|ht)tp:\/\/[a-z0-9~#%@\&:=?\/\.,_-]+[a-z0-9~#%@\&=?;\+\/_-]+)/ig
    elm.innerHTML = elm.innerHTML.replace(regex, '<a href="$1">$1</a>')
}
</script>
 
</head>
<body>
<div>
    <div>
        <div id="spam">
spam eggs            http://vg.no foo bazx http://adressa.no
        </div>
    </div>
</div>
<div>
    http://example.org/foo <!-- not modified-->
</div>
<div>
 
</div>
</body>
</html>

Tilbake til toppen ^