0

I can not call the javascript function with the following javascript link. What is the problem here anyone can help me here please.

$buttonMessage = '

 <a class="drupalchat-profile-un drupalchat_cng" 
 href="javascript:void(0)"    
 onclick="javascript:chatWith('.$pUsername.','.$profile_uid.','.$UserAvatar.','.$onof.')">  
 </a>'; 
2
  • 1
    we need to see more of your code - show us chatWith method and more of your php code Commented Jan 29, 2018 at 10:57
  • @messerbill you don't need some more code. Because the problem is all ' quotes Commented Jan 29, 2018 at 10:58

1 Answer 1

3

You've probably some JS errors, and need to add single quotes around your values :

$buttonMessage = '

 <a class="drupalchat-profile-un drupalchat_cng" 
 href="javascript:void(0)"    
 onclick="javascript:chatWith(\''.$pUsername.'\',\''.$profile_uid.'\',\''.$UserAvatar.'\',\''.$onof.'\')">  
 </a>'; 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.