1

I want to open image in new tab if some one click on legend "Click here".

<p className="legends"><FieldUrlRenderer text={'Click here'} url={imageList.Image ? imageList.Image["Url"] :''} className="Videolegends"  /></p>

Currently it is opening in same window if I click on link.

  • 2
    Check this. It opens image in new window. Or something like window.open(image.src, '_blank'); – Ganesh Sanap Feb 3 at 4:17
  • 1
    Or you can try adding your image somewhere in SharePoint library/picture gallery, Add a tag(hyperlink) with target="_blank attribute and give image path in href attribute. – Ganesh Sanap Feb 3 at 4:21
  • i have added a code which i am trying – kumar Feb 3 at 4:32
  • 1
    thanks this worked i changed it accordingly – kumar Feb 3 at 7:27
3

Try following workarounds:

  1. Using window.open():
    window.open(imageUrl, '_blank');
  1. Using Anchor tag / hyperlink:

    • Add your image somewhere in SharePoint library/picture gallery
    • Add anchor tag (hyperlink) with target="_blank attribute and give image path in href attribute.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.