It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Alternative way for this script?

Alternative way for this script?

Postby designadinblogg on Wed Aug 10, 2011 12:32 pm

I use this script on my website, where users can download a file but to be able to download it, they have to click on a other link to activate the download link.

The script looks like this:
Code: Select all
<script language="javascript">
function activateLink(obj){
myDiv=document.getElementById(obj);
myDiv.innerHTML='<a href="'+myDiv.attributes["value"].nodeValue+'" target=_blank>'+myDiv.innerHTML+'</a>';
}
</script>

<div id=link2>[include file="ad1.php"]</div><p>
<div id=link1 style="font-family: impact; font-size: 28px;" value="http://#/wp-content/plugins/download-monitor/download.php?id=79">Ladda Ner</div></p>


The include file contains this code:
Code: Select all
<a href="#" onclick="activateLink('link1');" target="_blank"><img src="#/wp-content/uploads/2011/04/103381.jpg" alt="Klicka här" border="0" /></a>


The problem I have is that user can't get the script to work, and it has been like this for the last week. Before that, it worked really good.

Anyone have an idea why it's not working?
designadinblogg
 
Posts: 1
Joined: Wed Aug 10, 2011 11:38 am

Re: Alternative way for this script?

Postby rajmv on Wed Aug 10, 2011 8:08 pm

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script language="javascript" type="text/javascript">
function activateLink(obj){
myDiv=document.getElementById(obj);
myDiv.innerHTML='<a href="'+myDiv.attributes["value"].nodeValue+'" target="_blank">'+myDiv.innerHTML+'</a>';
}
</script>
</head>
<body>

<div id="link2">[include file="ad1.php"]</div>
<div id="link1" style="font-family: impact; font-size: 28px;" value="/wp-content/plugins/download-monitor/download.php?id=79">Ladda Ner</div>


</body>
</html>
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 3 guests