Eliminating the need for the "http://" prefix in a URL loaded by

Visit my page for more details contains a list of advertisers' URLs in full, but I am unsure how to get rid of the http:// prefix.

See the following code:

<% if instr("abc"&rsAdvert("WebAddress"),"http:")>0 then
     shttp=""
 else
     shttp="http://" 
 %>
 <li class="weblink"> 
   | <a onclick="pageTracker._trackPageview('/TOP_FULL_ADVERT_WEBSITE/<%=shttp%><%=rsAdvert("WebAddress")%>');"
        href='<%=shttp%><%=rsAdvert("WebAddress")%>'
        target='_blank' rel='nofollow'>
    <%=rsAdvert("WebAddress")%></a></li>
<% end if %>

Any suggestions would be appreciated.

Answer №1

Did you give this a go?

const website = "Specify your URL here";
website.replace("https://", "");

Answer №2

In order to rectify this issue in your code, you will need to make adjustments to the following section:

<a href="url">text</a>
              ^^^^

Currently, your link appears as follows:

<a 
    onclick="pageTracker._trackPageview('/TOP_FULL_ADVERT_WEBSITE/<%=shttp%><%=rsAdvert("WebAddress")%>');" 
    href='<%=shttp%><%=rsAdvert("WebAddress")%>' 
    target='_blank' 
    rel='nofollow'>
    <%=rsAdvert("WebAddress")%>
</a>

Therefore, it is necessary to modify the part just before the </a>, specifically focusing on the end segment:

><%=rsAdvert("WebAddress")%></a>
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^

You should replace it with a variable that excludes the "http://" portion.

The following adjustment may be effective, although classic ASP syntax compatibility is not guaranteed:

 ><%=rsAdvert("WebAddress").replace("http://", "")%></a>

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

Creating a Javascript countdown timer that does not involve displaying the

I stumbled upon this code on a website, but there's one tweak I'd like to make. Unfortunately, I can't seem to figure it out myself, so I'm reaching out for some help. What I want to achieve is removing the year from the date so that th ...

Tips for retrieving the ID of a dynamic page

In my Higher Order Component (HOC), I have set up a function that redirects the user to the login page if there is no token. My goal is to store the URL that the user intended to visit before being redirected and then push them back to that page. However, ...

Issues with the visibility of inlined styles within the Angular component library

After developing a custom library with components for an Angular 4 application, I encountered an issue where the CSS styling from the components was not being applied when using them in an application. Although the functionality worked fine, the visual asp ...

"Troubleshooting: The v-model in my Vue project is not functioning properly when used

I am encountering an issue where the v-model directive is not functioning properly inside a v-for loop. Within my template <li v-for="(data, key) in product.variants" :key="data.id"> <input type="radio" :id=" ...

Generating objects based on comparing values between two arrays

First time tackling a question, so I will strive to articulate the problem clearly. I have two arrays containing different values and my goal is to map the values from the first array (which are inputs) to the second array (which are outputs). If the val ...

Struggling to send the correct cookies to the API server using Next.js

I have set up an API express server on api.mydomain.com and a Next.js website on mydomain.com. My Next.js application uses getServerSideProps to request data from the API for displaying on the page. However, I am facing an issue where I can set cookies for ...

Troubleshooting: JSColor Is Failing to Function Properly in Volusion's

Recently, I've encountered some issues with the JSColor plugin () on the Volusion e-commerce platform. Despite having successfully used it before, getting it to load correctly seems to be a challenge. My current task involves working on a test produc ...

Merge arrays of objects if they share at least one common property

// The following is an array that needs to be transformed const data = [ { name: 'shanu', label: 'ak', value: 1, }, { name: 'shanu', label: 'pk&ap ...

Combine several items to form a single entity

When I have two objects returned from the database, my goal is to combine them into one object. Here are the examples: { "id": 4, "first_name": "s", "last_name": "a", ...

Issue encountered when trying to access the webpage through a puppeteer connection

I am currently experimenting with web scraping using the puppeteer library to extract data from a Chrome page. I have managed to connect to an existing Chrome page in debugging mode by obtaining the ws URL and successfully establishing a connection. Here i ...

Choose from the dropdown menu: click to select multiple options or deselect all by selecting a single option

Is there a way to create a Select box where all options can be selected with a single click and then unselected with another single click? The goal is to only allow the user to select one option at a time, rather than multiple options. <script src="h ...

Why does Vue keep-alive fail to function properly when there is a nested div?

What causes the interruption of keep-alive functionality by this particular div? <keep-alive> <div> <suspense> <component :is="Component"> </suspense> </div> </keep-alive> Placing the ...

Interacting with iframes using JSDOM: Manipulating div elements

Attempting to extract information from the website http://www.example.com, which contains the following HTML code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My site</title> </head> <b ...

Sharing the input value with a service in Angular 4

I am a beginner when it comes to Angular 4. I currently have a variable named "md_id" which is connected to the view in the following way. HTML: <tr *ngFor="let item of driverData"> <td class="align-ri ...

Having trouble with a background image not showing in IE8 on a button?

My submit button has the following CSS styling: .button{ border:1px solid #015691; background-image:url('http://boundsblazer.com/pkg/pics/ buttons/small-button.png'); color:#ffffff; height:18px; font-size:8pt; ...

Is employing absolute paths in our confidential Node dependencies a good idea?

I have recently organized our codebase's React components into a separate dependency to make them reusable across different projects. To improve readability, all components now utilize Webpack aliases: import TestComponent from 'components/TestCo ...

The PKIJS digital signature does not align with the verification process

Explore the code snippet below const data = await Deno.readFile("./README.md"); const certificate = (await loadPEM("./playground/domain.pem"))[0] as Certificate; const privateKey = (await loadPEM("./playground/domain-pk ...

Performing aggregation in MongoDB to calculate the sum total

I'm trying to figure out how to calculate a sum based on a specific row in the mongo aggregation module. Here is the structure of my document: { "_id" : "315" "city" : "Dallas", "population" : 3400, "state" : "Unknown" } How c ...

sending data from a servlet to ajax

Implementing a star-based voting system involves sending an ajax request to update the database through a servlet when a user casts their vote. This is the ajax code used: $.ajax({ type:'GET', contentType: "charset=utf- ...

Showing PHP array in the JavaScript console

I have a straightforward AJAX script that sends 3 variables to an external PHP script. The external script then adds them into an array and sends the array back. I want to output this array in the JavaScript console to check if the variables are being pass ...