Outputting jquery.html() to be used in an email

I'm sorry for the length of this question, but I want to make sure I give the facts. I have a new ad server which does 99% of what I need. The one area it doesn't work so great in is in sending text ads. Here's the scenario. I need to send an email and this email needs some text ads in case the user has images turned off. Our email client (Lyris) uses `httpget` to grab our dynamically generated page. Now here is where the problem lies. The new ad server uses JavaScript to grab the ads off of their server. They offer email compliant tags, but nothing for text ads. So I thought I would load the text ad using their standard javascript on a page. I would then pull that data into a variable based on an ID. Ex: span id="ad" Here is the jQuery code: var j = jQuery.noConflict(); j(document).ready(function () { var ad = j('#jscript').html().replace(/)<[^<]*)*<\/script>/gi,''); j('#ad').html(ad) }); Here is my script code to call my ad position and display on the screen: So I'm grabbing the data based on my span id and then removing any reference to script tags. What I'm left with is just the text of the ad, which is perfect. I can dump that on the screen and it looks and works great when viewing through a browser. But because I'm doing all of this in jQuery when I send through Lyris it obviously ignores my javascript. So how would I be able to output the results of `var ad = j('#jscript').html().replace(/)<[^<])<\/script>/gi,'');` into something my email client won't ignore?
No mail reader I'd ever use would execute JavaScript in emails.

以上就是Outputting jquery.html() to be used in an email的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准