Virginia Democrat Richard J. Davis released a series of foreign policy statements tonight in an effort to rebut charges by his Republican senatorial opponent, Paul S. Trible, that he has a "shocking lack of knowledge" of world affairs.

Trible's attacks represent a new campaign offensive in which he is accusing Davis, the state's lieutenant governor, of being indifferent to a potential Communist takeover in Central America and making "preposterous" comments on issues ranging from the Middle East to nuclear arms talks.

The attacks infuriated Davis' campaign organization, which at first tried to downplay the injection of foreign policy into the debate. "I hardly think this is the consuming issue of the campaign," said campaign manager James Carville.

Later, however, Davis' camp responded by putting out a series of statements in which Davis expressed his support for military and economic aid to "democratic societies" in Central America and backed the Camp David peace process in the Middle East.

The foreign policy spat was sparked by a Washington Post story in which Davis was quoted as offering a number of vague answers to various foreign policy issues. Asked about military aid to El Salvador he replied: "I don't have a preference as to the current government or the insurgent government."

Holding up a copy of the Post story before a luncheon audience in South Boston, Trible said: "My opponent's answer indicates that he would not care if a Communist regime were to take control of this strategic Latin American country, a regime which would align itself with Castro's Cuba and the Kremlin."

A Davis spokesman called the Trible charge "ridiculous" and said Davis supports the president's policy in El Salvador.

Trible also tried to ridicule a Davis response to a question of Israeli settlements in the West Bank. "I can't comment on that," the 61-year-old former Portsmouth mayor told The Post.

The 35-year-old Newport News congressman, however, quickly found himself under attack for giving misleading comments on the same issue before a predominantly Jewish audience at an Alexandria synagogue last Sunday. Trible said today that he is opposed to Jewish settlements in the West Bank on the grounds that they "complicate the peace process." Yet when asked about the West Bank at the Beth El synagogue on Sunday, he replied, "Oh, you mean Judea and Samaria" and made no reference to the question of such settlements.

"He was misleading people," said Del. Bernard Cohen (D-Alexandria), who was representing Davis at the synagogue appearance. "Judea and Samaria is the ancient Israeli name for the West Bank so the implication was that he considered Judea and Samaria part of Israel . . . . If you don't believe in settlements on the West Bank, you don't refer to it as Judea and Samaria."

Trible denied today that this represented a contradiction. "I wasn't asked about the settlements," he said.