User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 426,434 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,330 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1119 | Replies: 0
Reply
Join Date: Jun 2005
Posts: 29
Reputation: zoned is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
zoned zoned is offline Offline
Light Poster

Help Problem with Javascript on Webpage

  #1  
Jul 1st, 2005
Hi all,
I have spent a long time trying to get this sorted. I have searched high and low to get an answer. I hope one of you experts can help :mrgreen:

I have a gif on a webpage (a chinese flag).
When someone clicks on the gif they are brought off to Babalfish for a translation of the page. This works fine. EXCEPT.
Instead of hardcoding each URL e.g. www.mysite.com/news.htm into the gif link I tried to use a piece of Javascript that shows the URL of the page. This means that I can put this code on my web page template and I will not have to hardcode the URL.

Original Code for gif link.
<a href="http://babelfish.altavista.com/babelfish/trurl_load?url=http%3A//www.mysite.com/&lp=en_zh"><img src="http://www.mysite.com/images/flags/cn.png" alt="Simplified Chinese" width="25" height="15" border="0"></a>


Attempted Code for Javascript....
<script language="JavaScript">
<!-- 
document.write (location.href)document.write ("<p>")
document.write ("<a href='"+location.href+"'>Link To Current Page</a>")
document.write ("<a href=http://babelfish.altavista.com/babelfish/trurl_load?url="+location.href+">Here</a>")
// -->
</script>


I have tried many variations.
Anyone got any ideas?
Thanks in Advance
Zoned.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 2:36 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC