0

newbie question alert! :)

I am trying to convert this JavaScript that is loaded on the page to a PHP script as in IE 8 the values are not loaded.

This is the part of .js that I want to convert

 $(document).ready(function() { 
 var user = loadCurrentUser();
 var user_id = user['user_id'];
 $('form[name="updateAccount"] input[name="email"]').val(user['email']);

I tired several versions of php code but nothing seems to be working.

Any help would be highly appreciated!

3
  • 1
    You want to manipulate the DOM in PHP? That's really not going to work. Commented Feb 5, 2015 at 21:17
  • Maybe it would be possible to set the value of the email input to a certain users email using php. To find that out we should know what the loadCurrentUser() function does. But anyway, I'm sure the smarter way is to solve the IE8 issue. Commented Feb 5, 2015 at 21:24
  • Why not try using AJAX? You can use JavaScript to call a PHP function via AJAX Commented Feb 5, 2015 at 21:27

1 Answer 1

2

You cannot simply convert this JS snippet to PHP. Instead, you'll need to debug why this isn't working in IE8. I suspect it has something to do with the loadCurrentUser() function.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.