I have this i’m trying to output in PHP:
$this->Js->buffer("
var searchTerm = $(this).html();
var searchId = $(this).attr('data-tag');
$('.tags').append('<input type='text' value='+searchTerm+' name='data[Tag][tags]['+searchId+']'');
");
But i’m unsure about quotes and javascript variables as well.
Can anyone help out?
You can also stop single and double quotes from tripping you up by swapping singles for doubles, e.g.:
Would output: