Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    333
    Thanks
    38
    Thanked 0 Times in 0 Posts

    Insertimage In Document.execcommand Not Appearing

    So I made a function to insert image through document.execcommand in Javascript..

    Code:
    function images() {
    var img = prompt ("Enter the image link", "");
    if (img != null) {
    lol.document.execCommand("insertImage", false, img);
    }
    };
    The image is not appearing, even on live server.. It shows the broken image icon. This code is supported by all browsers. The rest of my execcommand functions are working well.. I checked the code in Inspect element in Firefox and Chrome, they are displaying the image with the tags and link well, but still show the broken image icon.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,590
    Thanks
    0
    Thanked 644 Times in 634 Posts
    execCommand is only supported by Internet Explorer - it isn't intended for use on the internet.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Regular Coder
    Join Date
    Sep 2011
    Posts
    333
    Thanks
    38
    Thanked 0 Times in 0 Posts
    nope, the issue has been solved.. its because the link did not put the image format... i dont know know where to mark the thread as solved here...on coding forum, can you guide me?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •