Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error when call deleteContents() method of range object

Status
Not open for further replies.

Tiono

Programmer
Feb 24, 2004
11
0
0
ID
anybody know why if I call deleteContents() in below code, it will have error msg "object doesn't support this property or method" ???

Code:
function do_header() {
	DHTMLSafe.focus();
	var txt = "[header]" + DHTMLSafe.DOM.selection.createRange().htmlText + "[/header]";
	var range = DHTMLSafe.DOM.selection.createRange();
	range.deleteContents();
}
 
try this

Code:
function do_header() {
    DHTMLSafe.focus();
    var txt = "[header]" + DHTMLSafe.DOM.selection.createRange().htmlText + "[/header]";
    var range = DHTMLSafe.DOM.selection.createRange();
    range.selectNodeContents(range);
    range.deleteContents();
}
 
still error simonchristieis

range.selectNodeContents(range) will raise same error message "object doesn't support this property or method" :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top