Assign Javascript popup HTML link to PHP variable -
Assign Javascript popup HTML link to PHP variable -
i trying assign next php variable:
[<a href='"'javascript:pop_booking_item_add({id})'"'>add new item</a>]
i have tried this:
$add_button = "[<a href='"'javascript:pop_booking_item_add({id})'"'>add new item</a>]";
but getting error message:
error: syntax error, unexpected ''javascript:pop_booking_item_a' (t_constant_encapsed_string)
i think need escape quotes i'm not sure how to?
this should work:
$add_button = "[<a href='javascript:pop_booking_item_add({id})'>add new item</a>]";
or
$add_button = "[<a href=\"javascript:pop_booking_item_add({id})\">add new item</a>]";
javascript php html escaping variable-assignment
Comments
Post a Comment