simplet split replace

Mit split und replace einen Link ändern

Der hier verwendete Code

<img src="" id="bild"> <script> var dein_link='https://www.wikidata.org/wiki/Q2318609#/media/File:Messenkamp - St. Georgkapelle - SO.JPG'; var split_jpg=dein_link.split('File:'); var link=split_jpg[1].replace(/\s+/g, '_'); // console.log(link); // console.log('https://upload.wikimedia.org/wikipedia/commons/c/c2/'+link); document.getElementById('bild').src='https://upload.wikimedia.org/wikipedia/commons/c/c2/'+link; </script>

Add Comment

* Required information
1000
Drag & drop images (max 3)
Powered by Commentics

Comments

No comments yet. Be the first!