tomtimms Posted May 12, 2011 Share Posted May 12, 2011 I am trying to replace a [href] attributes with php code in a jquery return. Here is what I have so far. $('#account_setting').attr('href', '<?PHP url_for('Account/Settings/site_id/'+data) ?>'; I am not sure what I have wrong, as it gives me "missing )" error code. Link to comment https://forums.phpfreaks.com/topic/236209-php-inside-of-jquery/ Share on other sites More sharing options...
gristoi Posted May 12, 2011 Share Posted May 12, 2011 $('#account_setting').attr('href', '<?PHP url_for('Account/Settings/site_id/'+data)) ?>'; Link to comment https://forums.phpfreaks.com/topic/236209-php-inside-of-jquery/#findComment-1214520 Share on other sites More sharing options...
Maq Posted May 12, 2011 Share Posted May 12, 2011 You also probably have to escape the single quotes inside your url_for function parameter. Link to comment https://forums.phpfreaks.com/topic/236209-php-inside-of-jquery/#findComment-1214524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.