469,315 Members | 1,562 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

javascript var id from datbase

229 100+
Hi, Anyone know how to solve the following, if I can describe it well enough.

I have a database with interface.
I have a webpage with javascript popups. the links are as follows

[HTML]<a href="http://www.site.com" id="tip297">name</a>[/HTML]
in the head I have the external js file linked where all the ids are kept.
they are like this

Expand|Select|Wrap|Line Numbers
  1. var tip6 = '<img src="a/6.jpg"><div class="tp2">name</div>';
As I have over 300 ids the external file is big, and having a search function on the site I dont want to have to download the whole file when only a few links with ids are thrown up, but instead only the ids associated with the links found in the search.
So I am trying the following. I have an unused form field in my database interface that will insert text into the page for each link dynamically. I am trying to insert the line like

Expand|Select|Wrap|Line Numbers
  1. var tip6 = '<img src="a/6.jpg"><div class="tp2">name</div>';
into the page.

The insertion code is asp like this

Expand|Select|Wrap|Line Numbers
  1. <%=rsCard("CardDescription")%>
I believe if put right it could include the js ref for each link. But anyone know how and where? In the link I have an id="" so I imagine the insertion code should go in the head but know idea how!

Hope someone understands my language.
Thanks
Richard
Jul 26 '07 #1
1 1448
pbmods
5,821 Expert 4TB
Heya, Richard.

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Jul 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.