Help

URL from attached documents not opening correctly

Solved
Jump to Solution
3044 13
cancel
Showing results for 
Search instead for 
Did you mean: 
Jon_Eynon
6 - Interface Innovator
6 - Interface Innovator

USING API TO CREATE WP SITE.
Hi all. So I have rows of data and a column in the row is Attachments. It is just as it sounds, an uploaded document.

My code to generate the URL into content on the page is:
f=String(record.get(“Application Name”));
l=record.get(“Attachments”);
container+="<a href=’"+l[0][‘url’]+"’ target=’_blank’>"+f+"";

The resulting URL is below:
Aviation Workers Comp Instructions
When this URL appears out on the page and I click on it, I get an error that says
http://dnserrorassist.att.net/search/?q=http%3A//ar.ecologik.netnull/&r=http%3A//ar.ecologik.net/app...
NOW, if I right mouse click on any of the links and have it open in a new window the docs load just fine. I notice that there is a null being thrown in the error message. Where is that coming from? I am at a lost on this one!

1 Solution

Accepted Solutions
Jon_Eynon
6 - Interface Innovator
6 - Interface Innovator

The issue was in some local javascript that was causing a null to get applied at the end of the url. It was carry over code from another page. Links were just fine and AirTable acting as it should. Thanks for helping troubleshoot. Case closed

See Solution in Thread

13 Replies 13
Jon_Eynon
6 - Interface Innovator
6 - Interface Innovator

Well, I notice when I click on the link in my post it works. Is this a cross scripting issue in that my test site is not https?

There are reasons this [may] work with a right click, but I believe that is accidental and likely related to the way browsers attempt to sanitize incorrect URL references.

If you look at this code fragment, something is not right about it and the missing closing anchor tag may be part of the problem.

<a href=’" + l[0][‘url’] + "’ target=’_blank’>" + f + "";

I recommend you share three things:

  1. The actual URL you see in the lower bar in the browser when you hover over the link.
  2. The actual URL by right-clicking and copying the URL.
  3. The actual HTML code for the entire part of the web page where the URL is rendered.

Probably not. This is likely because this community platform is sanitizing the URL and attempting to correct it – OR – it is your browser doing the lifting to unencode the URL for rendering.

Creation Code
container+="<a href=’"+l[0][‘url’]+"’ target=’_blank’>"+f+"";
Hover Over URL:

AvCompInstruct2.pdf

70.99 KB


Actual Code:

  • Fixed Base Operations - GL
  • Thanks Bill.
    Jon_Eynon
    6 - Interface Innovator
    6 - Interface Innovator

    Was going to post the website but my API is exposed until I server side parameter the thing at launch. Bill if you have an email I could send you the site that way if you think seeing might help.

    @Jon_Eynon,

    Your HTML code is wrong if what you’re showing me is the complete code that renders the link.

    It is missing the closing anchor tag.

    image

    This is not the actual HTML code because the community platform is allowing the browser to interpret the HTML you are pasting. You need to paste an image of the actual code for me to see it.

    image

    Try this -

    1. Display the page;
    2. View the source;
    3. Find the place where this link is rendered;
    4. Take a screenshot of that area of the code from at least the beginning to end of the anchor tag.
    Jon_Eynon
    6 - Interface Innovator
    6 - Interface Innovator

    AirTable

    Thanks again.