Link to home
Start Free TrialLog in
Avatar of casit
casitFlag for United States of America

asked on

execute php inside javascript code.

I have the following piece of javascript/php.  It doesn't work.  Any thoughts?  Oh and the javascript is inside a .js file and I can't put the javascript inside the browser script tags.
var postForm =
                  '<form id="ys-post-form"' + (this.prefs.inverse ? 'class="ys-inverse"' : '' ) + '><fieldset>' +
                        '<input id="ys-input-nickname" value="<?php echo $userdata['username']; ?>" type="text" accesskey="N" maxlength="' + this.prefs.nicknameLength + '" class="ys-before-focus" />'
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

try rename that js file to .php and try again?
Avatar of casit

ASKER

Avatar of casit

ASKER

Sorry meant to say that I did try renaming it and still the same results.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of casit

ASKER

No that didn't work but unfortunatelty this feature has been moved down to the bottom of the project list at the moment.  I will however award you the points.