Wstawić tabelkę do WebBrowser...

0

Witam! Mam taką sprawę. Mam WebBrowsera w trybie edycji. Stawiam kursor w jakimś miejscu i teraz potrzebuję funkcji/procedury, która wstawi w to miejsce jakiś element (np. tabelkę) mając tylko kod źródłowy tego elementu w HTML. Istnieje taka możliwość? Z góry dzięki.

0

Na stronach M$ znalazłem takie coś (z opisu WebBrowsera). Może ktoś z tego coś wywnioskuje. Ja kombinuję i nic mi nie wychodzi.

The following example shows how to use the CreateLink constant as the sCommand of the execCommand method to allow the user to create a hyperlink from selected text. The scriptMicrosoft JScript then retrieves the specified URL and uses it to replace the selected text.

Copy Code

<html> <body>

Creating a Link and Retrieving the URL

<script> function AddLink() {//Identify selected text var sText = document.selection.createRange(); if (!sText==""){ //Create link document.execCommand("CreateLink"); //Replace text with URL if (sText.parentElement().tagName == "A"){ sText.parentElement().innerText=sText.parentElement().href; document.execCommand("ForeColor","false","#FF0033"); } } else{ alert("Please select some blue text!"); } } </script>

Select any portion of the following blue text, such as "My favorite Web site". Click the button to turn the selected text into a link. The text will be changed to the URL that you specify.

My favorite Web site is worth clicking on. Don't forget to check out my favorite music group!

<BUTTON onclick="AddLink()" unselectable="on">Click to add link</BUTTON>

</body> </html>

1 użytkowników online, w tym zalogowanych: 0, gości: 1