Hi Sushuma,
I hope I understand your question correctly; is it a many-to-many association? It sounds like you only need the name of the object B and feed that as a variable in the following JavaScript client API call to get the associated objects of type A. So, say you have a module named 'ModuleName' and a variable <NameOfB> which holds the name of the target instance of object type B, the following JS code should retrieve the associated objects of type A:
mx.data.get({
xpath: "//ModuleName.A/ModuleName.A_B/ModuleName.B[Name = " + <NameOfB> + "]",
callback: function(objs) {
console.log("Received " + objs.length + " MxObjects of type A associated to object B with name: " + <NameOfB>);
}
});