-1

我有一个网址:

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

我需要插入一个&wid=800&hei=800after imageres=300,所以生成的 URL 将是:

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

在 jQuery 中执行此操作的最简单方法是什么?谢谢你的帮助 :)

4

2 回答 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.

于 2013-05-29T13:37:56.850 回答
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
于 2013-05-29T13:34:05.223 回答