Script for displaying user-specific links
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   m_b
Posted On:   Wednesday, April 9, 2003 10:43 AM

I am very new at JavaScript- so I apologize if this question is too simplistic. I have created this script to display links if a specific value is passed to it. Can you look at this and tell me what I am doing wrong? Thanks in advance function getLinks(status){ var my_array = new Array(); if(status == "JOHN SMITH"){ Link 1 Link 2 Link3 my_array[0] = document.anchors("Link 1"); my_array[1] = document.anchors("Link 2"); my_array[2] = document.anchors("Link 3"); } for (i = 0; i < my_array.length; i++) { document.write(document.anchors(i)); } }    More>>

I am very new at JavaScript- so I apologize if this question is too simplistic. I have created this script to display links if a specific value is passed to it. Can you look at this and tell me what I am doing wrong?


Thanks in advance
			
function getLinks(status){

var my_array = new Array();
if(status == "JOHN SMITH"){
Link 1
Link 2
Link3

my_array[0] = document.anchors("Link 1");
my_array[1] = document.anchors("Link 2");
my_array[2] = document.anchors("Link 3");
}
for (i = 0; i < my_array.length; i++) {
document.write(document.anchors(i));
}

}
   <<Less

Re: Script for displaying user-specific links

Posted By:   Nitesh_Naveen  
Posted On:   Thursday, April 10, 2003 01:22 AM

Guess this is a continuation of your earlier question. By storing links into arrays I meant storing the entire link there. For eg.
 

Re: Script for displaying user-specific links

Posted By:   Firat_Tiryaki  
Posted On:   Wednesday, April 9, 2003 01:56 PM

Use "['index']" instead of "('index')" while using array objects such as document.anchors



And remember that jguru is the place you can ask any kind questions. Do not avoid to ask.

About | Sitemap | Contact