-1

I have an URL:

https://papermusepress.scene7.com/is/image/papermusepress?layer=0&src=fxg{papermusepress/5x7Shape3?$Embed1_5x7Shape3=BBS_BM0V_011_00&**imageres=300**}&scl=1&fmt=png-alpha&qlt=90&extend=10,10,10,10&effect=-1&blendMode=mult&op_grow=3&op_blur=4&color=0,0,0,120

and I need to insert a &wid=800&hei=800 after imageres=300, so the resulting URL would be:

https://papermusepress.scene7.com/is/image/papermusepress?layer=0&src=fxg{papermusepress/5x7Shape3?$Embed1_5x7Shape3=BBS_BM0V_011_00&imageres=300&wid=800&hei=800}&scl=1&fmt=png-alpha&qlt=90&extend=10,10,10,10&effect=-1&blendMode=mult&op_grow=3&op_blur=4&color=0,0,0,120

What would be the simplest way to do this in jQuery? Thanks for any help :)

1
  • 3
    url = url.replace('imageres=300}', 'imageres=300&wid=800&hei=800}') ? Commented May 29, 2013 at 13:29

2 Answers 2

0

Please note that you can append only 256 characters in your url. more than that will result in error or the request will be denined.

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

1 Comment

its scen7 urls of images
0
var url1 = 'https://papermusepress.scene7.com/is/image/papermusepress?layer=0&src=fxg{papermusepress/5x7Shape3?$Embed1_5x7Shape3=BBS_BM0V_011_00&imageres=300}&scl=1&fmt=png-alpha&qlt=90&extend=10,10,10,10&effect=-1&blendMode=mult&op_grow=3&op_blur=4&color=0,0,0,120';
var url = url1.split('?');
params = url[2];
params =  params.split('&');
params = params[1].split('}');
var old_image = params[0];
var new_image = old_image.concat('&wid=800&hei=800');
url2 = url1.replace(old_image, new_image);
alert(url2);

please use above java script and run. don't worry about variables.

it run fine for me

1 Comment

hi sameer.. 'imageres=300' value 300 can be variable.. it will vary image to image can u suggest any generic code..!!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.