insert text into head section of the page

insert text into head section of the page

Post by ramya.subr » Tue, 16 Dec 2003 14:47:06


Hi,

I am extending dreamweaver, and I want an insert function to insert some text into the head section of the page.I have to use the 'insertObject' api function,if anyone has a clue on this , pls let me know...

Thanks
Ramya
 
 
 

insert text into head section of the page

Post by ramya.subr » Tue, 16 Dec 2003 17:09:11

Hi,

I understand that I have to change the insertion point to some point in the head section and then use the insertHTML api, but its just not working, the code I am using is :


var theDOM = dw.getDocumentDOM();
var docStr = dw.getDocumentDOM().documentElement.outerHTML;
var head = docStr.indexOf('<head>');
theDOM.setSelection(head+6,head+6);
theDOM.insertHTML('some html here',false);


If anyone knows why this isnt working, please reply,

Thanks,
Ramya.