Programming

XML DOM compareBoundaryPoints() method

Definition and Usage

compareBoundaryPoints() method compares the position of two ranges.

Syntax:howcompareBoundaryPoints(sourceRange,

)

) Description
how parameter
sourceRange define how to perform comparison operation (i.e., which boundary points to compare). Its valid values are constants defined by the Range interface.

compareBoundaryPoints()

return value sourceRange বর্তমান পরিসরের বর্ণনাকৃত সীমান্তবিন্দু sourceRange বর্ণনাকৃত সীমান্তবিন্দুর আগে, -1 ফিরিয়ে দেওয়া হবে।যদি বর্ণনাকৃত দুটি সীমান্তবিন্দু একই থাকে, তবে 0 ফিরিয়ে দেওয়া হবে।যদি বর্তমান পরিসরের সীমান্তবিন্দু

বর্ণনাকৃত সীমান্তবিন্দুর পরে প্রত্যাহার করা হয়, তবে 1 ফিরিয়ে দেওয়া হবে。

যদি sourceRange represents the document represented by the current range is different from the document represented by the current range, this method will throw an error code of WRONG_DOCUMENT_ERR. DOMException exception

Description

This method compares the boundary points of the current range and the specified sourceRange এর boundary points and returns a value indicating their relative position in the source document. The parameter how একটি boundary point of two ranges which is to be compared. The valid values of this parameter and their meanings are as follows:

  • Range.START_TO_START - Comparing the start points of two Range nodes
  • Range.END_TO_END - Comparing the end points of two Range nodes
  • Range.START_TO_END - Using sourceRange এর start point-এর সাথে বর্তমান রেঞ্জের end point-কে তুলনা করা
  • Range.END_TO_START - Using sourceRange এর end point-এর সাথে বর্তমান রেঞ্জের start point-কে তুলনা করা

এই মথুকরণের ফলাফল একটি সংখ্যা হয়, যা বর্তমান রেঞ্জের সাথের position-কে ঘোষণা করে sourceRange এর position।তাই, আপনি মনে করতে পারেন যে, প্রথমে একটি parameter how এর boundary constants একটি range-এর boundary points নির্দিষ্ট করে, এবং তারপর তা নির্দিষ্ট করে sourceRange এর boundary point।কিন্তু একটি কনস্ট্যান্ট Range.START_TO_END একটি boundary point নির্দিষ্ট করে বর্তমান রেঞ্জের end point-এর সাথে এবং sourceRange এর start বিন্দুকে তুলনা করা।একইভাবে, কনস্ট্যান্ট Range.END_TO_START একটি তুলনা করে বর্তমান রেঞ্জের start বিন্দুকে একটি নির্দিষ্ট রেঞ্জের end বিন্দুর সাথে。