194
rated 0 times
[
196]
[
2]
/ answers: 1 / hits: 84835
/ 10 Years ago, tue, april 29, 2014, 12:00:00
Just like the title above: how to concatenate two strings in JQuery?
This is my code so far:
$(document).ready(function(){
serviceName = '<?=$_GET['services'] . .php;?>';
serviceID='<?= # .$_GET['services'];?>';
serviceClass = '<?=$_GET['services'];?>';
if (serviceName != ) {
alert(serviceID);
$('.main_content').load(serviceName);
$(serviceID).addClass(it);
}
});
As you can see in my above code, in variable name serviceID
, I am concatenating hashtag
and my GET
value and I try to put it on ALERT and the result is correct, but when I assign it to .addClass
it’s not working.
Any alternatives and solution is much appreciated.
More From » jquery