Re: Problem while inserting new element in webpage



"Vishal More" <vishalmore@xxxxxxxxxxxxxx> wrote in message
news:1118748979.920429.218030@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I am developing a ToolBand from few days, using this toolband the user
> can insert the elements into the webpages. The only thing user has to
> do is make a selection of element and place it on webpage.
>
> for inserting the element I have written code like :
> spElt = spDoc.elementfrompoint(x,y)
> spElt.insertAdjacentHTML("beforeEnd", "Element tag")
>
> This code works fine...But it fails when I click on some image in
> webpage, its giving error "Invalid target element for this operation".

You are trying to insert something here:

<img src="..."> <newElement> </img>

This would not be a valid HTML. Perhaps you want "afterEnd" ?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Problem while inserting new element in webpage
    ... I am developing a ToolBand from few days, ... for inserting the element I have written code like: ... webpage, its giving error "Invalid target element for this operation". ... Regards, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: [PHP] allowing access to php page by IP
    ... > certain webpage and keep everyone else out. ... I have written code to figure ... echo 'Get lost, ya bum!'; ...
    (php.general)