thanks for the feedback guys, i agree with th srp thing, but i also agree with keeping code to a minimum where possible, and i cant think through what im trying to do without making some very messy scripts.
the srp mentioned above refers to one particular function, what im trying to achieve would require atleast 3 functions to complete, which is fine, but the initial call function needs to return the result of the sub functions, and its becoing apparent that this isnt possible to do when user input is required inside one of the sub functions.
i think im going to make a function which will display items for the user to select, and each time i call it, il send a variable to it with the name of the function which will be called onclick when the user makes their selection like so
Code:
function showPeople(returnTo,firstId)
{
var str="<a href=\"#\" onclick=\""+returnTo+"("+id1+")\">".id1."</a>
str+="<a href=\"#\" onclick=\""+returnTo+"("+id2+")\">".id2."</a>
}
|