Assign Javascript popup HTML link to PHP variable -


I am trying to specify the following in PHP variables:

  [ Lt; A href = '' 'javascript: pop_booking_item_add ({ID})' '' & gt; add new item & lt; / a & gt;]   

I have tried to do this :

  $ add_button = "[& lt; A href = '' 'javascript: pop_booking_item_add ({id})' '' & gt; Add new item & lt; / A & gt;] ";   

But I'm getting an error message:

Error: syntax error, unexpected" Javascript: pop_booking_tam_A "(TokenNantNACAACEDI_TRTI) / P>

I think I need to avoid quotes, but I'm not sure how?

This should work:

$ add_button = "[& lt; A href = 'javascript: pop_booking_item_add ({id})' & gt; Add new item & lt; / A & gt;] ";

or

$ add_button =" [& lt; A href = \ "javascript: pop_booking_item_add ({id}) \" & gt; Add new item & lt; / A & gt;] ";

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -