0

Im trying to load a header from a html file into the html view that I want to populate with data using Postal. However this doesn't seem to be working even though I'm sure my code is syntactically correct. Everything gets returned in the email correctly except the header so I was wondering is this because of jquery?

Here is what the code basically looks like. Any advice would help. Thanks!

    <html>
    <head>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
    $(function() {
        $("#includHeader").load("header.html");
    });

</script>
</head>
<body>
    <div id="includHeader"></div>
    <!--Fill in data-->
</body>
</html>
jonv562
  • 293
  • 1
  • 4
  • 23
  • Is this the email you're sending, or the web page that the user uses to send the email? Mail readers will usually not execute Javascript. – Barmar Aug 07 '14 at 20:52
  • Its actually apart of the template, which gets sent as an email after the data is populated in the html file. But I'm not sure if the mail reader is in charge of executing the javascript or if Postal is. – jonv562 Aug 07 '14 at 21:49
  • From what I can tell from the web site, Postal is just used to create and send the mail, it's out of the loop once the end user receives it. Putting Javascript in the email will not work. – Barmar Aug 07 '14 at 22:53
  • Yea your right. I just figured that if Postal could add data to the email before sending it maybe it could also add html with the help of js, but I guess not. Thank you for your comments. – jonv562 Aug 07 '14 at 23:22
  • Postal runs on the server, you can add data to the email using ASP.NET functions. You can't do it using Javascript, which runs on the client. – Barmar Aug 07 '14 at 23:24

1 Answers1

0

Like in a web page, execution of JavaScript is the responsibility of the client, not the server. There is no guarantee that the mail-reader client will--or even have the ability to--execute any JavaScript code.

Marc L.
  • 3,296
  • 1
  • 32
  • 42