function addLink id type linksArray href http textOutLink val target _

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
function addLink (s, id, type) {
linksArray =['<a href = http://' + $('#textOutLink').val() + ' target = "_blank">',
'',
'<a href = "javascript: showParagraph(' + id + ',-1)">',
'',
'<a href = "javascript: showSummary(' + id + ')">'
];
$.getJSON($SCRIPT_ROOT + '/edit/linkProblem', {id: id},
function (data) {
linksArray[3] = '<a href = "javascript: showProblem(' + data.par_id + ',' + data.pr_num + ',-1)">';
console.log('<a href = "javascript: showProblem(' + data.par_id + ',' + data.pr_num + ',-1)">')
s = linksArray[type] + s +'</a>';
console.log(linksArray)
})
console.log(1)
console.log(s)
return s;
}