I am having problems trying to insert this function into this piece of code below.
[CODE=javascript]var pages=['www.lboro.ac.u k:degree programmes','ch annel4.co.uk', 'www.bbc.co.uk: sports', 'www.skynews.co m:the best election']
var w='degree'
var p=0
if(pages[p].indexOf(w)<0)
alert ('not found')
else
alert('found')[/CODE]
i want to use the function find_1(w,p) - to discover if the string w appears in the string pages[p]. Gives an alert of w 'found' or 'not found'. but when i put the function, it doesn't run
[CODE=javascript]var pages=['www.lboro.ac.u k:degree programmes','ch annel4.co.uk', 'www.bbc.co.uk: sports', 'www.skynews.co m:the best election']
var w='degree'
var p=0
if(pages[p].indexOf(w)<0)
alert ('not found')
else
alert('found')[/CODE]
i want to use the function find_1(w,p) - to discover if the string w appears in the string pages[p]. Gives an alert of w 'found' or 'not found'. but when i put the function, it doesn't run
Comment