Is JavaScript still running despite not displaying insecure items due to IE 8 security warning?

After a user completes a transaction on my site, the confirmation page displays Google conversion tracking code in a small JavaScript snippet. This code is located on my Wordpay callback page, which pulls data from the regular site (HTTP) to the Worldpay site (HTTPS), causing IE 7/8 to ask:

"Do you want to display non-secure items?"

If the user clicks "no," the CSS and styling info are removed, but the JavaScript code still appears in the page source.

I am curious whether the code actually executes when the user clicks "no." Since it is displayed, one would assume that it does. However, the source of the page still shows the CSS and image links, even though they are not rendered.

Answer №1

When your page is accessed from a secure https connection but contains elements loaded via an insecure http connection, a warning will be triggered. This means that if your Javascript is fetched from an unsecured source, it may be disabled even though it is still present in the code. In this scenario, Internet Explorer does not modify the DOM but simply chooses not to load certain external resources – hence why image tags and other elements may still appear in the source code without being rendered.

Answer №2

I encountered a similar issue where Internet Explorer prompts for the display of 'non-secure' elements, specifically for JavaScript and Flash content. The prompt doesn't bother me personally, but it can be problematic for users with high security settings that automatically decline such requests.

The webpage in question is www.zivljenje.com, which features a simple JavaScript code that generates a table with a random quote or "thought of the day". I have made some adjustments to the code for better visibility.

script language="JavaScript" type="text/javascript"> //THE TABLE

!-- var r_text = new Array (); r_text[0] = "THERE IS ONLY ONE LANGUAGE, THE LANGUAGE OF THE HEART. THERE IS ONLY ONE RELIGION, THE RELIGION OF LOVE. THERE IS ONLY ONE CASTE, THE HUMAN CASTE. THERE IS ONLY ONE GOD, WHO IS ALL-PERVADING."; r_text[1] = "Just as a well-spent day brings a happy sleep, a well-lived life brings a joyful death."; r_text[2] = "We cannot accomplish great things. Only small acts done with great love."; r_text[3] = "Make sure you get what you love, otherwise you will be forced to love what you get."; r_text[4] = "Courage is not the absence of fear, but rather the judgment that there is something more important than fear"; r_text[5] = "Experience is not what happens to you. It's what you do with what happens to you."; r_text[6] = "Ask yourself if what you are doing today is getting you closer to where you want to be tomorrow."; r_text[7] = "An ounce of time is worth an ounce of gold, but we cannot buy an ounce of time with an ounce of gold."; r_text[8] = "Truly happy is the person who can accurately assess themselves..."; r_text[9] = "I no longer choose to believe in old limitations and scarcity."

//END TABLE

var i = Math.floor(0*Math.random())

document.write(r_text[i]); //-->

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

By executing array1.splice(1,1), I am deleting elements from array2 that was generated by copying array1 with array1.slice(0)

I was working with JSON data and converted it into an array of objects. Then, I assigned that array to another array using the .slice(0) method. However, I encountered an issue where when I tried to remove an element from the assigned array, it also remov ...

Storing ajax data into a variable seems to be a challenge for me

I am facing an issue with my ajax call where I am receiving the data correctly, but I am unable to assign it to a local variable named item_price. The data that I am receiving can either be 100.00 or 115.25. Below is the snippet of my ajax code: $.ajax({ ...

Utilize Node.js to parse JSON data and append new nodes to the final output

When parsing a JSON object in Node.js, the resulting hierarchical object can be seen in the debugger: datap = object account1 = object name = "A" type = "1" account2 = object name = "B" type = "2" If we want to add ...

Removing the Login button from the layout page after the user has logged in can be achieved by

I am currently developing an MVC application in Visual Studio 2012. Within my layout page, there is a login button that I would like to hide after the user successfully logs in. Despite my attempts, the method I am using doesn't seem to be working. Ca ...

broker handling numerous ajax requests simultaneously

Is there a way to efficiently handle multiple simultaneous ajax calls and trigger a callback only after all of them have completed? Are there any JavaScript libraries available that can manage numerous ajax calls to a database at the same time and execute ...

It is not possible to transfer information to a JSON document using node.js filesystem and browserify

In an attempt to convert incoming input data from a form into JSON format for storage without a backend, I am exploring the use of Node.JS module "fs" or "file-system". To make this work in a browser environment, I am using Browserify for bundling as it r ...

Is it possible to swap a <div> element with the content of another HTML page using the .innerHTML method?

I am currently working on a project that involves loading different webpages into a <div> on my page once specific links are clicked. I came across a thread about using jQuery for this purpose, but I'm not familiar with it. Is there a way to ach ...

Guidelines for incorporating Angular variables into jQuery scripts

I have a form with an input field that dynamically generates a list of names using Angular. My goal is to turn each name into a clickable link that will submit the form with that specific name as the input value. <form method="POST" action="/results/" ...

The page reloads automatically following the completion of an ajax request

Hey there, I have a basic form with just a text field. When we submit the form, the data entered in the text field gets stored in the database through ajax. Although the ajax function is working properly and the data is being submitted, the page automatica ...

Add custom scripts to individual components within a Vue.js application

After extensive searching, I still can't seem to find a solution to my current issue. My focus is on a Vue project with vue-cli, where I need to inject various scripts into different pages (leveraging vue-router). Here are more specific details: Thi ...

How to toggle the visibility of specific div elements within a v-for loop depending on their content?

I am working on a scenario where I have a collection of objects displayed in a v-for loop. Each object has a specific key value pair, and I want the user to be able to toggle a button outside the loop to show or hide elements based on that key value. Initi ...

How to send a PHP array to AJAX and show it on the webpage

Looking to enhance the interactivity of my website by showing icons (either correct or false) after users submit a registration form. This way, they can easily identify any incorrect fields. To achieve this, I understand that I'll need to utilize jso ...

The process of creating a mind map with blank spaces included

I am working on creating a mapping system that links companies with their logos. The goal is to display these logos on a google-map. While completing the company-logo association map, I noticed that some vessel names contain white spaces, causing a compil ...

How to handle an unexpected token error when using a function within another function in

I'm encountering an issue where the function below is placed above my render function. It doesn't seem to allow me to nest a function within another function. Can you help me identify what's causing this problem? onSelected(i){ this.st ...

Scraping multiple websites using NodeJS

I have been immersing myself in learning NodeJS and experimenting with web scraping a fan wikia to extract character names and save them in a json file. I currently have an array of character names that I want to iterate through, visiting each URL in the a ...

Vuetify's v-list-item no longer has spacing issues when using the v-slot:prepend feature

Currently, I am in the process of designing a side navigation using v-navigation-drawer. While most of my items utilize an icon, I also want to create some custom behaviors. Unfortunately, the title in v-slot:title does not align with the title in the v- ...

The Vue template syntax utilizes double curly braces for incrementing values within must

Embarked on learning Vue.js recently and I am intrigued by the unusual behavior in my simple code. I cannot seem to figure out what is going wrong. I am attempting to increment a counter inside mustache syntax, but something strange is happening with this ...

I'm looking to include a field card into the to-do table I built using .Net, but I'm not sure where I made a mistake

HTML Challenge I have set a goal to dynamically add a DOM element using JavaScript when the "Add HTML Element" button is clicked. The process involves clicking the button, which opens a modal for inputting necessary information. After fil ...

Transforming an interactive HTML webpage into React/JSX

Imagine a scenario where I have two files: example.html <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="u ...

What's the alternative now that Observable `of` is no longer supported?

I have a situation where I possess an access token, and if it is present, then I will return it as an observable of type string: if (this.accessToken){ return of(this.accessToken); } However, I recently realized that the of method has been deprecated w ...