Dec 11, 2019 04:48 PM
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!
Solved! Go to Solution.
Dec 13, 2019 05:29 AM
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
Dec 11, 2019 04:49 PM
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?
Dec 12, 2019 05:15 AM
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:
Dec 12, 2019 05:18 AM
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.
Dec 12, 2019 06:50 AM
Creation Code
container+="<a href=’"+l[0][‘url’]+"’ target=’_blank’>"+f+"";
Hover Over URL:
70.99 KB
Dec 12, 2019 06:59 AM
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.
Dec 12, 2019 07:19 AM
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.
Dec 12, 2019 07:21 AM
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.
Dec 12, 2019 07:26 AM
Try this -
Dec 12, 2019 01:21 PM
Thanks again.