What's the correct way to write this link?

Here's the starting point:

<a href = "#" class = "pers_med_record" data-toggle="control-sidebar" data-id = "'.$EId.'" data-primary_id="'.$PrimaryID.'">'.$PrimaryID.'</a></td>'

I've got a link that triggers a function. That link needs to have the "primary_id" embedded in it so that this...

$.get('../primary_includes/ee_health_record.php?EId=' + $(this).data('id')+&PrimaryID=$(this).data('primary_id'), function(data) {

...is poised and ready for action.

I'm not writing that second part correctly. It works fine as this:

$.get('../primary_includes/ee_health_record.php?EId=' + $(this).data('id'), function(data) {

...but when I try to add the "primary_id" dynamic, it fails.

What am I doing wrong?
brucegustPHP DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
You've got a couple of missing quotes in your concatenation. You need this:

$.get('../primary_includes/ee_health_record.php?EId=' + $(this).data('id') + '&PrimaryID=' + $(this).data('primary_id'), function(data) {

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brucegustPHP DeveloperAuthor Commented:
Excellent!

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.