需要使用 jQuery 更改标记才能与厚盒 iframe 一起使用(第二次尝试)

发布于 2024-09-04 12:19:31 字数 1581 浏览 6 评论 0原文

这是解决此问题的修订尝试。原谅我的菜鸟。

我在一个我无法直接访问的页面上有以下标记...

<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');"><img src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif" border="0" align="absmiddle"></a>

我需要上面的代码看起来像这样,以便thickbox可以打开一个iframe...

<a 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="thickbox"><img border="0" align="absmiddle" src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif"></a>

我最初想到的是首先添加一个“类” Thickbox”到第一组代码,这样我就可以更容易地定位第一组代码并进行设置,以便它可以被 Thickbox 使用

然后我期望做什么来定位在productid=之后的值,在这种情况下是“318”并将其放入变量中,例如var proid

然后我将定位 escape('LB30X40ES') 中的值并将其放入变量中,比如说 var procode

然后我将定位 orig_price 中的值,即 22.95并将其设置为 var proprice

对高度和宽度执行相同的操作。

然后构建新的 href =/bulkDiscounts.asp?productid='proid' + &productcode +'procode' + &orig_price + 'proprice' + &keepThis=true&TB_iframe=true&height='height'+ & ;width + width

说明如何使用新标记/href 更新旧标记。

这是我能解释的最好的

解释我必须使用变量(我认为)的productid、productcode、orig_price、高度和宽度是因为它们根据加载的产品页面而变化。

请注意,新标记中不需要此代码...

“折扣”、“滚动条、状态、可调整大小”

希望这有意义吗?有人吗?

This is a revised attempt at solving this issue. Excuse my noobness.

I have the following markup on a page of which I do not have direct access to...

<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');"><img src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif" border="0" align="absmiddle"></a>

I need the above code to look like this so thickbox can open up a iframe...

<a 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="thickbox"><img border="0" align="absmiddle" src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif"></a>

I has originally thought of first adding a class of "thickbox" to the first set of code so I can target the first set of code easier and setit up so it can be used by Thickbox

Then what I would expect to do what to target the value in just after the productid= which in this case is "318" and put that in a variable, lets say var proid.

Then I would target the value in the escape('LB30X40ES') and put that in a variable, lets say var procode

Then I would target the value in orig_price which is 22.95 and put that is var proprice.

The do the same for height and width.

Then build the new href =/bulkDiscounts.asp?productid='proid' + &productcode +'procode' + &orig_price + 'proprice' + &keepThis=true&TB_iframe=true&height='height'+ &width + width

The figure out how to update the old markup with the new markup/href.

This is the best that I can explain it

The reason I have to use variable (I would think) for productid,productcode,orig_price,height and width is because they change depending on what product page is loaded.

Note this code is not needed in the new markup...

'Discounts', 'scrollbars,status,resizable

Hope this makes sense? Anyone?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文