b u d d h a ha scritto:
hi,
i have more than 20 images in a form
which might be refering like this image src = images/search.gif/
i want a jquery script for replacing all image src with image src =
http://s.images/images/search.gif/
This is the code, but personally I prefer make changes
Sorry i forgot the braces.
This is the right code:
$('img').each(function() {
$('img').attr({'src': http://s.images/+$(this).attr('src')});
});
--
gianiaz.net - web solutions
via angelo custode, 10 - 23100 sondrio (so) - italy
+39 347 7196482
i tried but not wrking
am placing a sample code which i used
script type=text/javascript
$(document).ready(
$('img').each(
function()
{
$('img').attr({'src', http://localhost/
s.demo/+$(this).attr('src')});
b u d d h a ha scritto:
i tried but not wrking
am placing a sample code which i used
script type=text/javascript
$(document).ready(
$('img').each(
function()
{
$('img').attr({'src', http://localhost/
Giovanni Battista Lenoci wrote:
Maybe I confused you.
You've mixed two types of syntax. You can achieve this with 2 syntax:
1.
$('img').each(function(){
$('img').attr({'src': http://localhost/s.demo/+$(this).attr('src')});
});
2.
$('img').each(function(){
Shawn Grover ha scritto:
You have a slight issue with the samples. The first instance of
$('img') inside the function() should be $(this).
Sorry, you're right... I've answered without the right attention :-P
Giovanni
--
gianiaz.net - web solutions
via angelo custode, 10 - 23100 sondrio (so)
6 matches
Mail list logo