add more javascript code for supporting attach data reference