Have an a tag with a link to another website inside my data.jsx array but it says link not found when I try to visit it on my local dev

Santa

I have a data.jsx page with multiple data arrays which I then map out on my component jsx file. one of the array entries is a link in an a tag but when I try to visit the link on my localdev it presents me with an error; problem is clearer below

here is part of my code for my data.jsx file:

id: 1, /* RESILIENT FITNESS */
    img: Work1,
    modalImg: WorkModal1,
    title: 'Website Build',
    details: [
      {
        icon: <FiFileText />,
        title: 'Project : ',
        desc: 'Website',
      },
      {
        icon: <FiUser />,
        title: 'Client : ',
        desc: 'Resilient Fitness',
      },
      {
        icon: <FaCode />,
        title: 'Language : ',
        desc: 'HTML, CSS, JavaScript',
      },
      {
        icon: <FiExternalLink />,
        title: 'Preview : ',
        desc: <a href="www.example.com">Click Here</a>,
      },

the last part has a desc with a preview so viewers can visit the website by 'clicking here'; however Im not sure if the issue is the code itself or its because Im working on my local dev (localhost:5173); this is the error when I actually try to click on 'Click Here' in the desc

enter image description here

I'm not sure if this is only happening as Im on a localhost; will the issue resolve itself once I deploy the website?

sharvil pandit

As you can see you want to redirect on some page but the error shows the link is postfixed to localhost url. and hence it's giving you error.

Currently I've a solution is to call a function on click and in that function assign the url.

const somefn=()=>{
window.location.assign(url_goes_here);
}

Hope It'll help. Thanks

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I add an "Add to Favorites" button or link on my website?

How can I toggle my overlays so it can close when another link is clicked?

Digital Assets Link link to my website

Failed to find Build Tools revision 27.1.1. When I try to download, says it has no download link:

"Accounts failed to link" error happens when I try to authorize Google Assistant at my Web service

I want to add image when I share my website link

My website crashes when I click a certain link twice

I need to link to another HTML page inside my current HTML page using JavaScript or HTML

How do i properly link my css and html file together, inspect element says "ERR_FILE_NOT_FOUND"

My drop down menu does not show when I move my mouse from the anchor tag link on my menu

Android http URL scheme is not working when I try to launch my application from a link on my website

Trying to visit my website at /get_started redirects to / when I copy and paste, but not when I type it manually

My CMS is stripping out the ? at the end of a URL when I try to save the link... is there a way to make it stick?

when I click on link on my website it is not opening? why is it so?

How can I have refresh page link/button inside my JavaScript code?

Can I link to specific pages on my website from a facebook game?

I am not able to figure out a bug that is when I try to click on a link on my website it appears the 404

Android unit testing, says I have no tests inside my class, although I have 1

Can i select the second link inside my navigation link

How can I use a link on my website to open an application?

I have a problem with two .js files in a react app! I am using the react-router-dom. My problem is with the Link tag

How to I get the api. before my website link

I want my homepage to be replaced when I click on a link to another page, but instead, the other page is added to my home

I have a button inside my grid view, I want to send data to another activity when the button (which is inside grid view) is clicked

I want to Link my NEXT.js project with a static website

How to push my local commit when my github have another commit and i forgot to pull my commit in github

my entire website shakes when i click on a link and a border is displayed

OneDrive says "test copy link local document" when I try to share the link

What's the cause of this link error when I try to link my executable to my library by name?