IMG SRC tags and JavaScript

前端 未结 13 1226
眼角桃花
眼角桃花 2020-12-02 02:09

Is it possible to call a JavaScript function from the IMG SRC tag to get an image url?

Like this:





        
13条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 02:29

    you could dynamically feed the image by calling an aspx page in the SRC.

    Ex;

    
    

    On the page side, you`ll need to put the image in the response and change the content type for an image.

    The only "problem" is that your images won't be indexed a you better put some cache on that provider page or you'll ravage the server.

提交回复
热议问题