Need to change markup with jquery

I have the following markup with which I do not have direct access ...

<a href="javascript:void(0);" onclick="window.open('/BulkDiscounts.asp?ProductID=318&ProductCode=' + escape('LB30X40ES') + '&Orig_Price=22.95', 'Discounts', 'scrollbars,status,resizable,width=330,height=300');"><iimg src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif" border="0" align="absmiddle"></a>

I need to “rewrite” the above as shown below.

A few things to indicate that the title comes from the variable escape (global_Current_ProductCode) variable = productcode

The values ​​for height, width, price and product used in the second layout should be from the first layout. Please note that this change depends on the loaded product page. These are not constants.

I would suggest that the first thing to do is add a class of thick columns. Then I get lost as to what to do next.

Basically, I need to open the pushbox iframe with the modified layout.

+3
source share
3 answers

Register and ask again in a more understandable way.

+1
source

The second part was as follows:

<aa href="/BulkDiscounts.asp?ProductID=318&ProductCode=LB30X40ES&Orig_Price=22.95&keepThis=true&TB_iframe=true&height=300&width=330"

title = "LB30X40ES Laundry bags" class = "thick box"> img border = "0" align = "absmiddle" src = "/v/vspfiles/templates/100/images/ buttons/btn_quantitydiscounts.gif">

0
source

Unconfirmed - should close you:

var re = /.*?\(('.*?'),.*?'(.*?)'.*(width=\d*).*(height=\d*).*/;
var match =  $("a").attr("onclick").match(re);
eval("var url = " + match[1]);
$('a').unbind('click').click(function() {
   TB_show(match[2], url + "&keepThis=true&TB_iframe=true&" + match[3] + "&" + match[4]);
});
0
source

Source: https://habr.com/ru/post/1749149/


All Articles