[addon] This should be editable

admin

Administrator
Staff member
This is the java file:

var _cm_Links = new Array();
var _cm_linkcnt = 0;

// ==========================================
// Function to read the link,
// the text and the URL from the custom links
// ==========================================

function _cm_LinkObject(Name, Text, URL)
{
this.Name=Name;
this.Text = Text;
this.URL = URL;
return this;
}

// =============================
// BEGIN OF Custom links
// Define your custom links here
// =============================

// ====================
// Custom links
// ====================

_cm_Links[_cm_linkcnt++] = new _cm_LinkObject("sluvshare", "Special Lighting File Server on BU Lamps", 'http://www.test.com/speciallighting');

// ===================
// END OF Custom links
// ===================

// ======================================
// Functions to make to whole thing work,
// Do Not EDIT These Funtions
// ======================================

function _cm_ListLink(Name, optional)
// write html code for link with Name and append optional part to URL of link.
{
var lastPart=optional || "";
for (i=0; i<_cm_linkcnt; i++)
if (_cm_Links.Name == Name)
document.writeln("<a href=http://www.webdeveloper.com/forum/archive/index.php/"+_cm_Links.URL+lastPart+">"+_cm_Links.Text+"</a>");
}

function _cm_ListLinks()
{
for (i=0; i<_cm_linkcnt; i++)
document.writeln(_cm_Links.htmlcode + "<br>");
}


This is the code to include on my page

<script language="JavaScript" src="http://www.test.com/links.js"></script>
<script language="JavaScript">_cm_ListLink("sluvshare", "/common_files/bl_uv_organogram.doc");</script>

I would like to make the code so that i can give the name of the hyperlink thats is stored, in the javascript.

So i would like to do something like this

<script language="JavaScript"
<B>Organogram</B>src="http://www.test.com/links.js"></script>
<script language="JavaScript">_cm_ListLink("sluvshare", "/common_files/bl_uv_organogram.doc");</script>


i hope i make myself clear

Thank You in advance
 
Top