Absolute URLs function similarly to relative URLs

I have a collection of links displayed in the footer section of my Angular 1.3.15 app.

HTML

<section class="footer-projects">
        <div class="container">
            <div class="row">
                <section ng-repeat="area in ::links">
                    <h4 ng-bind="area.title"></h4>
                    <ul>
                        <li ng-repeat="project in ::area.projects">
                            <a href="{{project.url}}" ng-bind="project.name"></a>
                        </li>
                    </ul>
                </section>
            </div>
        </div>
    </section>

The ng-repeat function iterates through the listed items.

JS Constants

'use strict';

require('./footer.module.js')
    .constant('FooterLinkConstants', [
        {
            title: 'Space',
            projects: [
                {
                    name: 'Galaxy Zoo',
                    url: 'http://www.galaxyzoo.org/'
                },
                ...
            ]
        }
    ]);

This is the custom directive implemented:

JS Directive

'use strict';

require('./footer.module.js')
    .directive('appFooter', appFooter);

// @ngInject
function appFooter($state, FooterLinkConstants) {
    var directive = {
        link: appFooterLink,
        restrict: 'A',
        replace: true,
        templateUrl: 'footer/footer.html'
    };
    return directive;

    function appFooterLink(scope) {
        scope.links = FooterLinkConstants;
        });
    }
}

During development everything functions properly. However, after deploying to a remote server, the server's address is added to the existing URLs in the footer list. For example:

instead of

http://www.galaxyzoo.org/

The URL becomes:

http://preview.zooniverse.org/folgerdemo/http://galaxyzoo.org/

You can view the live demo (inspect the footer links).

What could be causing this issue?

Some other resources, like this one, suggest using absolute URLs by including the protocol within the addresses; which I have already done.

I feel like I might be overlooking something obvious and would appreciate a fresh perspective on the matter.

Answer №1

Yes, only I held the key to the solution in this case - not due to its complexity, but because I omitted crucial details from my initial query.

I created my own version of an existing application. This particular app utilizes Gulp as its task manager.

The issue stemmed from this specific line of code:

gulp.src(filename).pipe(replace(/(href=")(?![http|\/\/])/g, '$1' + prefix))
,

where the value of prefix varied depending on the AWS S3 bucket type being used, causing it to interfere with URL links.

After disabling that line, everything went back to normal.

I appreciate the input from those who commented and apologize for any time wasted ;)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Store fresh JSON information in a newly created JSON document

As someone new to JavaScript, I really appreciate your assistance. I'm utilizing the randomuser.me API to generate a list of users, but the names are all in lowercase. With the help of someone else, I managed to capitalize the names using a script. N ...

Selenium: The ultimate guide to inserting text within a div element located inside an iframe

Snippet of HTML code: <div class="listRte__editorFrame"> <iframe src="about:blank" style="height: 150px;"> #document <html> <head> <body> ...

Is it possible to attach the entered URL to an image following the text that has been inputted?

I've coded everything but the jquery part isn't working. Enter URL :<input type="text"> <button id="btn"> continue </button> <div contenteditable="true" id="bod"> Click here to start typing</div> $(document).ready( ...

liberating RAM in three.js

My application is loading a large number of meshes. When I try to dispose of old meshes to free up memory, it seems the memory is not actually being released. Am I missing something? Here is a simple example to reproduce the issue: Load 100 large binary ...

Using JavaScript, pass a single parameter to a function that accepts multiple arguments

Within my service, the Angular function is defined as follows: $delegate.isConfigurable = function (product, config) { if (product) { ///..... } return config.getDetail(); }; ...

Setting up Vagrant with Xvfb Troubleshooting

Setting up a vagrant machine with Ubuntu 14.04 to conduct tests using Selenium and Protractor. The goal is to execute all tests on this headless machine without the need for a graphical interface, just plain terminal output. Following these resources for ...

Sharing Data via JSON for a Pop-Up Display

section of a website, there is a button that, when clicked, triggers a small pop-up. The data being posted appears to be in JSON format as seen in HttpFox. Personally, I have little knowledge of javascript and AJAX. When the specific button is clicked, i ...

Learn the simple trick to switch to full screen by just clicking

import { Component, OnInit, ElementRef } from '@angular/core'; declare var JQuery : any; @Component({ selector: 'app-presentation', templateUrl: './presentation.component.html', styleUrls: ['./presentation.c ...

How can data be effectively passed between templates in Angular?

I have two templates: in the first template, I am using a function and after its successful execution, I want to retrieve data in the second template. How can I achieve this? Both templates are utilizing the same controller. First Template: <form ng-s ...

Problems with the firing of the 'deviceready' event listener in the PhoneGap application

Utilizing vs2012, I have been working on a PhoneGap application. Within this application, the following JavaScript code is being used: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { // alert("hh") ...

Is there a way to prevent a bootstrap modal from opening?

Recently, I encountered an issue with a button on my webpage: <a data-toggle="modal" href="#influencerModal" class="btn btn-primary influencer-card">Influencer Profile</a> I wanted to prevent the modal from opening when the button was clicked ...

Transfer data from an HTML form -> call the ajax load() function

My Current HTML Form Situation Currently, I have an HTML form set up with a text input field and a submit button. When the button is clicked, I want the output results to display in only a specific part of the page without refreshing the entire page. Ste ...

Select component experiencing issue with Material Ui label breaking

I've been working on implementing a select component, which is new to me. However, I'm encountering an issue with my MUI-select component. The label of the select element is no longer syncing properly with the select component itself as shown in ...

Is there a way in AngularJS to set all radio buttons to false when one is chosen as true?

When I retrieve true/false string values from the database, I am unable to alter the data. The example I provided is simply a representation of the string values true or false that I receive from the database. My goal is to have a single radio button disp ...

Tips on using the Unix "paste" command in Node.js without the need to load entire files into memory

Implementing the basic Unix paste command in Python is straightforward, as shown in the following snippet (which currently processes two files, unlike Unix paste that can handle multiple files): def pasteFiles(file1, file2): with open(file1) as f1: w ...

Is it feasible to append an element to the result of a function that returns an array?

Is it possible to push something to an array returned by a function, but not directly? Instead, I want to push it back into the function itself. hierar() { return [{ h: 1 }, { h: 2, hh: [{ u: 2.1 }, { u: 2.2 }] }, { h: 3, hh: [{ u: 4 }, { U: 5 } ...

What is the procedure for manipulating a string within an array of objects with a string key-value pair using underscore.js?

I am seeking a solution utilizing underscores, but I am open to a vanilla JS alternative if it proves to be the most effective option. My goal is to utilize array 2 to modify strings in the objects of array1 that either start with or end with the strings ...

Modify the width measurement from pixels to percentage using JavaScript

Looking for some help with a content slider on my website at this link: . I want to make it responsive so that it adjusts to 100% width. I managed to make it responsive by tweaking some code in the developer tools, but now I'm stuck. The bottom two p ...

The destroy method of Chart.js does not appear to have any impact on the

Hello, I've come across this issue in my react app that I need help with: this.chart = new Chart(node, options); // adding data to the chart ... this.chart.destroy(); this.chart = null; this.chart = new Chart(node, options); // adding data to the cha ...

Is it possible to transfer information to a state using ui-router?

When calling a state, I currently have the following code: self.$state.go('heat', { subjectId: self.sus.subject.id, examId: self.exs.exam.examId, testId: self.test.testI ...