The Dignity Project, an Edinburgh-based charity which promotes the education for African children, posted a message from its official Twitter account linking to an article about the donation.

"What a #b**** after we gave her shelter in our city when she was a single mum," the tweet read.

Patrick Harvie MSP, co-convenor of the Scottish Green Party - who back independence - replied on Twitter: "A comment like that is a disgrace to the Yes cause, and to the cause of social justice."

A spokesman for the Office of the Scottish Charity Regulator said: "We are making urgent inquiries into the matter and will be seeking further information from the charity trustees."

The charity's post was just one of a number of abusive messages posted by online nationalists angered by Rowling's public support of the pro-UK Better Together campaign.

She was variously described as a "w****", a specky "b******", a "Union cow bag" and a "disgrace" in social media messages.

Downing Street condemned the abusive messages. "There is never any place for abusive behaviour in whatever sphere of life. It's important to be clear about that," the Prime Minister's Official Spokesman said.

He welcomed Rowling's comments. "He encourages and welcomes support for the case for the UK staying together from across all quarters."

John Lamont, Scottish Conservative Chief Whip, said: "JK Rowling is one of Scotland’s best known exports and is a tremendous ambassador for the country.

“Yet today, because she has decided to back the case to keep Scotland part of the UK she is forced to endure the most extreme personal abuse imaginable. Some of the comments made about her are abhorrent and if they were made public in the street would surely be a criminal offence.

“No doubt, there will now be the usual small-minded comments for people to boycott her books. There is clearly an orchestrated campaign from the top of the Yes campaign to smear anyone who dares to disagree with them."

A spokesman for Yes Scotland said: "While we may disagree with her views, we of course completely respect JK Rowling and her right to express her opinion on the referendum and donate to the No campaign.

"And while we do not agree with her choice, we can all agree with her strong point that if the majority of people in Scotland do vote Yes, then she truly hopes that it is a 'resounding success'."

A statement later posted on the Dignity Project website said its Twitter account had been hacked.

"We are not responsible for any tweets that have been sent," the statement said. "As a charity we do not take any political stance and our opinion is people are free to donate to whoever they choose."