antonioking
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/res ources/lgn topl-1.gif ";
}
if (location.hostname == 'mail.2.com')
{
lgntopl = "owa/14.1.438.0/themes/res ources/lgn topl-2r.gi f";
}
</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.
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/res
}
if (location.hostname == 'mail.2.com')
{
lgntopl = "owa/14.1.438.0/themes/res
}
</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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Great! Im glad you got it working :)
ASKER
My solution resolves my issue, Pierre's suggestion of adding 'var' before my variable led me down my path
ASKER
I have added "var" but just get a blank page now.
Is there anything else wrong with my syntax? I did just guess it!