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. Quote 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)) ?>'; Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/236209-php-inside-of-jquery/#findComment-1214524 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.