My codes for sdp javascript