Variable with JS / Html

Asked

Viewed 77 times

-1

Anyone who can help,

I need to mount an email signature where the image link I need to upload was composed and inserted into a JS (linkAss) variable.

I am unable to load the image into the HTML (Link Variable).

How can I do that?

<html>
<head>
<title>Empresa</title>
<link href='http://fonts.googleapis.com/css?family=Raleway:500,700,900,400,300' rel='stylesheet' type='text/css'>
<style>
html, body { font-family: 'Raleway', sans-serif; }
</style>
</head>
<script type="text/javascript">
var linkAss = "https://wp.net/ImagensAss/" + %%userPrincipalName%% + ".png"
</script>
<body>
<table cellspacing="0" cellpadding="0" width="" border="0">
<tr>
<td width="100" style="vertical-align: top;">Variavel do Link</td>
  • 1

    than to be %%userPrincipalName%% ?

  • is an Active Directory variable I take the data of this variable and compose with the rest to form a url of the image saved in my database.

  • I’ll try it out, thanks for the help

  • Worked perfectly...

1 answer

0

That’s it ?

    <html>
    <head>
    <title>Empresa</title>
    <link href='http://fonts.googleapis.com/css?family=Raleway:500,700,900,400,300' rel='stylesheet' type='text/css'>
    <style>
    html, body { font-family: 'Raleway', sans-serif; }
    </style>
    </head>
    <script type="text/javascript">
    function load(){
      var userPrincipalName = "name";
      var linkAss ="https://wp.net/ImagensAss/"+userPrincipalName+".png";
      document.getElementById('link').src = linkAss;
    }
    </script>
    <body onload="load()">
    <table cellspacing="0" cellpadding="0" width="" border="0">
    <tr>
    <td width="100" style="vertical-align: top;"><img src="" id="link"></td>
    </tr>
    </table>
    </body>
    </html>

  • <td width="100" style="vertical-align: top;" id="link"></td> On this line where the id="link" is, it brings the url, but how do I load the image to the page?

  • in this variable "linkAss" I store the image url and show in the id-"link", but how do I load it instead d show?

  • ah yes, I’ll change the answer

  • ready! Sorry for the delay.

  • 1

    You are an angel, thank you very much!!! Helped me a lot... :)

  • Marks the answer as a certain pf

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.