function(a) { var clink = $("#ID22").val(); if ($(".finder:first", a).attr('href') == undefined) { $('#submit').click(); } else { $('#error2').fadeIn(1000);$('#error2').text('Ссылка +clink+ уже есть в нашей базе');setTimeout('$("#error2").fadeOut(1000);',3000); return false; } });} 

Hello!

I'm just starting to learn javascript. So do not judge strictly. I have a function that looks for similar links on pages. But all this is not particularly important.

The problem is that I can not make the output links (from the field) in the "alert" on the divas. That is, I prescribe

 var clink = $("#ID22").val(); 

and insert

 $('#error2').text('Ссылка +clink+ уже есть в нашей базе'); 

But + clink + does not work. Please correct, who knows. :) I would be very grateful to you.

Closed due to the fact that it was off-topic by Athari , Timofei Bondarev , PashaPash , zb ' , fori1ton May 1 '15 at 15:29 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Athari, Timofei Bondarev, PashaPash, zb ', fori1ton
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Concatenation of strings in javascript is done as follows:

     $('#error2').text('Ссылка ' + clink + ' уже есть в нашей базе'); 
    • Oh, thank you so much. :) - SkaZzzz