0

Hello i made a code where i get the last part of the src data and replace _t for empty space like this.

 // Get the current image number
        var current = $(next.index("img"));

        var nextUrl = next.attr("src").replace("_t", "");

This is the img example

<img src="http://farm1.static.flickr.com/28/66523124_b468cf4978_t.jpg" />

so in the example case i get this URL

http://farm1.static.flickr.com/28/66523124_b468cf4978

My question is ... I have to modify that code to actually change that at the beginin of the URL

in the Script im working now the thums are

<img id="extra_15" src="data/16/t_15_images.jpg" border="0" width="70px" class="">

And the big images are

<img id="extra_15" src="data/16/15_images.jpg" border="0" width="70px" class="">

how do i change that?

1
  • beginning, middle, end, doesn't really matter as long as there is only one occurence of _t in the string. Commented Jun 5, 2013 at 16:33

1 Answer 1

2

Switch around the pattern you are looking for. Instead of _t do t_.

var nextUrl = next.attr("src").replace("t_", "");

Sign up to request clarification or add additional context in comments.

1 Comment

Damn jajaja im so tired, yep just realized how stupid is my question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.