Link to home
Start Free TrialLog in
Avatar of antonioking
antoniokingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Display different img src depending on hostname

I am trying to edit the logon.aspx file for Exchange 2010 OWA.
I have no knowledge on aspx coding, but some experience with VB, html, and php.

I'd like it to display 1 image for one domain, and a different image for another domain.

How can I achieve this?
Is there a way to set a string and use it later in aspx the aspx file?

Here is what I am trying...

<script type="text/javascript">
      if (location.hostname == 'mail.1.com')
      {
            lgntopl = "owa/14.1.438.0/themes/resources/lgntopl-1.gif";
      }
      if (location.hostname == 'mail.2.com')
      {
            lgntopl = "owa/14.1.438.0/themes/resources/lgntopl-2r.gif";
      }
</script>
<img src="<%lgntopl;%>" alt="">

When I load my page I get an error "XML Parsing Error: no element found"
So clearly, there is something wrong with my guessed logic above!

Any help, would be greatly appreciated.
SOLUTION
Avatar of Pierre Cornelius
Pierre Cornelius
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of antonioking

ASKER

Hi PierreC
I have added "var" but just get a blank page now.
Is there anything else wrong with my syntax? I did just guess it!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great! Im glad you got it working :)
My solution resolves my issue, Pierre's suggestion of adding 'var' before my variable led me down my path