I have a report in SSRS with a column that has a comma separated list of IDS (1, 2, 3) Each ID is a link that opens the profile page of that id.
I created all the links in SQL so my value after running the query looks something like
<a target="_blank" href="https://myurl.com/ViewPerson.aspx?PersonID=4417">4417</a>, <a target="_blank" href="https://myurl.com/ViewPerson.aspx?PersonID=15859">15859</a>, <a target="_blank" href="https://myurl.com/ViewPerson.aspx?PersonID=18533">18533</a>, <a target="_blank" href="https://myurl.com/ViewPerson.aspx?PersonID=56670">56670</a>, <a target="_blank" href="https://myurl.com/ViewPerson.aspx?PersonID=90498">90498</a>, <a target="_blank" href="https://myurl.com/ViewPerson.aspx?PersonID=292347">292347</a>, <a target="_blank" href="https://myurl.com/ViewPerson.aspx?PersonID=381594">381594</a>
The report looks good but the target=_blank is not working and all the links are opening in the same window.
What can I do to open these in a new tab/window?
Thanks.
I ended up using JS to open it in a new window.
4417, 15859, 18533, 56670, 90498, 292347, 381594
And this is working fine now.
Thanks.
Related
I am trying to get people to follow my twitter and discord by clicking on the words "Twitter" or "Discord" in the midst of my text. How would I do that below?
<p className="leading-[1.8] md:leading-[1.8] text-base md:text-xl max-w-[700px] my-9 font-secondary">
Follow
us on Twitter or join us in Discord to receive all pertinent news as it happens.{' '}
</p>
Thanks in advance!
You can try using span when nested. Little extra so that when clicked they open up on separate tabs.
<span> <a href="yourtwitter" target="_blank"
rel="noreferrer"> #yourTwitter </a> </span>
Try it plz. It works on my side.
//A simple link in Text to redirect an external website
<a className="leading-[1.8] md:leading-[1.8] text-base md:text-xl max-w-[700px] my-9 font-secondary" href="https://stackoverflow.com/questions/73980752/how-to-make-a-word-clickable-in-text-on-react-js/73980765#73980765" target="_blank" rel="noopener noreferrer">
Follow us on Twitter or join us in Discord to receive all pertinent news as it happens.{' '}
</a>
React uses JSX (or TSX if you're using TypeScript), so you can use any standard HTML tags, including <a/> to link to things.
Follow us on Twitter
Just use the a tag like this:
<p>Follow me on Twitter</p>
When user click, it does not open nothing and once reload the browser the
anchor open the url social media and all is fine until user navigate to other
page and come back again to Contact page the problem is repeated
export const Contact = () => {
return (
<div className="socialMedia">
<p className="mb-3">VisÃtenos en nuestras Redes Sociales</p>
<ul >
<li>
<a href="https://www.instagram.com/fridartestudio"
target="_blank"
rel="noreferrer"
><i className="bi bi-instagram" id="inst" ></i></a>
</li>
<li>
<a href="https://www.facebook.com/fridarteestudio"
target="_blank"
rel="noreferrer"
><i className="bi bi-facebook" id="faceb" ></i></a>
</li >
</ul>
</div>
)
}
I would like to know how to solve this simple problem with my anchors links social media. thanks by the way
I tried out your code it's actually working fine for me. It's opening the social links and even after I navigate to other page and come back to Contact it still worked fine. How about you re-open your project with npm start
You can also read this out -
https://www.digitalocean.com/community/tutorials/creating-a-social-follow-component-in-react
I want to link downloadable content on my documentation and I tried putting in a link like this:
<a
href={
require("#site/static/img/04-api/01/API-Description.png")
.default
} download="file-name"
> download </a>
This generates following html:
<a download="file-name" href="/assets/images/API-Description-6aeb65d8ae136a70b1b5a3d916d27ca0.png"> download </a>
<a download="file-name" href="/assets/images/API-Description-6aeb65d8ae136a70b1b5a3d916d27ca0.png"> download </a>
When I click on the link, I get
"Page Not Found"
I am running version: 2.0.0-beta.17
I found two of doing this.
First, put the file inside the static folder.
Example: ./static/image.png.
1) Your way
<a href={ require("/image.png").default }>download</a>
2) Simple way
[download](/image.png)
** Note that we did not use the ! to indicate that is an image.
You had to use inline-html with the download attribute and target="_blank"
[not working](/logo.png)
<a href={ require("/logo.png").default } download={"origName"}>not working</a>
<a target="_blank" href={ require("/logo.png").default } download>working</a>
This feels like the dumbest question I've asked on SO. I can't figure out how to make an img tag clicable in React...
<a className="App-link" href="https://www.google.com" target="_blank" rel="noopener noreferrer">
<img src="facebook_ad.jpg" className="App-ad" alt="facebook ad" />
</a>
Why the above code doesn't work? When I click on the img it just selects it.
Ignore the question... I had my links wrapped in several divs and for some reason this was preventing the links to open. I removed those divs and now the link works.
i have used react router doms' Link:
<Link target="_blank" to={"www.mylink.com"} >mylink </Link>
but this would open new tab to http://localhost:3000/www.mylink.com
also, using a href:
<a href={'www.mylink.com'} target="_blank" > mylink </a>
does the same. opens new tab to http://localhost:3000/www.mylink.com
how do i open in new tab only the link?
try this
<Link target="_blank" to={"//www.mylink.com"} >mylink </Link>
or this
<a href={'//www.mylink.com'} target="_blank" > mylink </a>
for more reference:
Absolute vs relative URLs
https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax
I tried to use Link but I had the same problem. Now I'm using this
onClick={() => { window.open('LINK','_blank')}}
When I used Link like
<Link to={`//${isHrefVlaue}`}></Link>
this was opening without localhost, but it was missing the colon in https and not working as expected.
But then it worked after I replaced Link with an anchor like
<a href={isHrefVlaue}></a>