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

matlab - Deleting rows with specific rules -

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