Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is Javascript converting my absolute url to a relative one??? 2

Status
Not open for further replies.

Gert74

Technical User
Jan 26, 2001
48
0
0
NL
Hello,

I have an (in my opinion) awkward problem with Javascript. I include a file from a different site (actually it's a banner). The include banner contains images, and since they need to be displayed on a different domain I put the full path to the images in my Javascript. It looks like this:

.....
document.write ('<TD><A HREF=&quot;javascript:popitup();&quot;><IMG SRC=&quot; WIDTH=79 HEIGHT=60 ALT=&quot;Stembutton&quot;></A></TD>');
....

I include the file on the remote site like this:

<BODY>
...
<script language=&quot;Javascript&quot; src=&quot;...
</BODY>

The banner shows up correctly, but for some reason the &quot;<img src&quot; from the included file has been converted to a relative one, like this:
document.write ('<TD><A HREF=&quot;javascript:popitup();&quot;><IMG SRC=&quot;/salesportal/pix/stem.gif&quot; WIDTH=79 HEIGHT=60 ALT=&quot;Stembutton&quot;></A></TD>');

Which means it will look for the images on the site where the banner is included instead of the place where the banneris hosted. So no images show up.

Does somebody have a clue, because I am no Javascript hereo and I really don't know what the **** is going on here.

Greetz,
Gert




Gert
 
glad could help...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top