javascript - Can anyone tell me why I am getting Uncaught SyntaxError: Unexpected string? -


this code below.

the error above not move, trying lots of different variants.

var $token = $(this).attr('id'); var $itemid = $(this).find('input.id').val(); var $instaurl = 'https://api.instagram.com/v1/media/"'.$itemid.'"/likes?access_token="'.$token.'"'; console.log($instaurl); 

thanks

javascript uses + string concatenation:

var $token = $(this).attr('id'); var $itemid = $(this).find('input.id').val(); var $instaurl = 'https://api.instagram.com/v1/media/"'+$itemid+'"/likes?access_token="'+$token+'"'; console.log($instaurl); 

you used dot (.) php.

by way, not need use dollar sign variables in javascript!


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -