Join 300,579 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,227 people online right now. Registration is fast and FREE... Join Now!
html += "<a href="; html += "java script:dmxAdvLayerPopup(\'ClubDetails\',\'/Report_ShowInfoClubs_Public.cfm?ourkey=" html += Club html += "\',\'ClDet\',\'\',\'OS_Look\',\'center\',\'center\',850,650,0,true,false,false,80,\'\',\'\',0,false,\'\',\'\',0,false,\'\',1,5,true,false,\'#FFFFFF\')>View Club Details"; html += "</a>";
I use this code all over the place with no problems, usually I insert the variables in ColdFusion, but I inherited a page that uses javascript to parse a text file and pull the variables. The variable is Club, and it's four digits.
The above code should yield a link with a single long line, the four digits in the middle. If I just type in, say, 5555 instead of Club, it works fine. If I display Club alone, it shows a value. I have tried every combination I can think of, from arrays to replace - nothing works. The result is that only the first half of the URL is created.
Remove the space between "java" and "script" and make it all one word "javascript". Then give it another go and see if that fixes the problem. Make sure that Club is also set properly to the value you want to appear in the link.
The "java script" was a cut and past problem - it actually is
CODE
<a href=java script:dmxAdvLayerPopup('ClubDetails','/Report_ShowInfoClubs_Public.cfm?ourkey=xxxx','ClDet','','OS_Look','center','center',600,400,0,true,false,false,80,'','',0,false,'','',0,false,'',1,5,true,false,'#FFFFFF')>View Club Details</a>
What I am trying to do is replace the "xxxx" with the variable "Club" so I broke the line into parts.
The variable "Club" does have a value.
It has to be a security thing here - I jave typed out javascript as one word, but the save command breaks it into two words. Even in code form.
Thanks
Rick
This post has been edited by RichardDrew: 2 Jul, 2009 - 12:52 AM
<a href="java script:dmxAdvLayerPopup('ClubDetails','/Report_ShowInfoClubs_Public.cfm?ourkey='+Club,'ClDet','','OS_Look','center','center',600,400,0,true,false,false,80,'','',0,false,'','',0,false,'',1,5,true,false,'#FFFFFF')">View Club Details</a>
should do .. assuming you have assigned a value to the Club variable in the correct scope. to make sure just alert it first :
CODE
<a href="java script:alert(Club);dmxAdvLayerPopup('ClubDetails','/Report_ShowInfoClubs_Public.cfm?ourkey='+Club,'ClDet','','OS_Look','center','center',600,400,0,true,false,false,80,'','',0,false,'','',0,false,'',1,5,true,false,'#FFFFFF')">View Club Details</a>
hope this helps
QUOTE(RichardDrew @ 1 Jul, 2009 - 08:37 PM)
The "java script" was a cut and past problem - it actually is
CODE
<a href=java script:dmxAdvLayerPopup('ClubDetails','/Report_ShowInfoClubs_Public.cfm?ourkey=xxxx','ClDet','','OS_Look','center','center',600,400,0,true,false,false,80,'','',0,false,'','',0,false,'',1,5,true,false,'#FFFFFF')>View Club Details</a>
What I am trying to do is replace the "xxxx" with the variable "Club" so I broke the line into parts.
The variable "Club" does have a value.
It has to be a security thing here - I jave typed out javascript as one word, but the save command breaks it into two words. Even in code form.