Okay, i have been pulling my hairs since yesterday ( whatever left of it at least ) trying to solve this issue!
Scenario:
You login to the admin panel in wordpress to publish a new post or page with custom fields, you enter the custom field key and value then click “add custom field” button but nothing happens, the truth is it actually inserts the key and the value, the problem is there is no Ajax/Jquery visual feedback .
By examining the console window using firebug, you’ll get the following when clicking the button:
XML or text declaration not at start of entity [Break on this error] ... position='1'>< 
Super helpful post. I had the same problem and I posted about it (and gave you credit) on my site. Your fix worked great, though in my particular case I had to remove line breaks from places other than the beginning and end.
Thanks for the solution!
Wow… you are a guru!
I filnally solved this problem!
Thank you for your post!
Klauzz
Wow, thanks for this fix. I had two extra lines at the end of my functions.php and deleting them instantly made the Custom Fields AJAX start working again.
wow, this is hard to believe but fixed my problem too !
you saved my time !
Hi Moe,
Thanks a million for this fix.
This had me close fury for a whole day!
I owe you a beer.
Moe!
I had missing custom fields & problems in updating them…
You have saved my project, thanks a bunch wordpress guru!.
J
hi,
what are line breaks?I must remove empty lines?
Yes Morteza, empty lines.