-1

I need help with inserting php inside html. I have the below which causes me a javascript error.

The error being: Uncaught SyntaxError: missing ) after argument list. Can anyone help? Thanks

<a href="javascript:fin(<?php echo $character['addresses'][$i]; ?>) style="width:100%; height:100%;">

Martyn P
  • 1
  • 1

2 Answers2

-1

You aren't closing your href property. Just add the closing double-quotes after your javascript parentheses. See the code below:

<a href="javascript:fin(<?php echo $character['addresses'][$i]; ?>)" style="width:100%; height:100%;">
Ryan
  • 579
  • 1
  • 5
  • 17
-1

Very strange, but an error within my javascript function cause the issue. I made a typo on a window.close call, I had put window..close by mistake.

Not sure why this would cause this error however I am also assuming that not closing the a href tag correctly would have caused a further error after correcting my double ..

Thanks for your help guys.

Martyn P
  • 1
  • 1
  • Problems caused by typos are off-topic because they are unlikely to help future visitors. You can delete this answer and then delete the question, to save it spending time in the review queues. – miken32 Nov 17 '18 at 03:59