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

What steps can I take to bring this idea to life in my gallery?

Currently, I am facing a roadblock while transitioning my design concept into actual code. My main concern lies with creating this art piece. Although the gallery is up and running with all the images in place, I'm encountering difficulties with the s ...

Is it possible to direct the user to a particular link upon swiping to unlock?

Hello everyone, I could use some assistance with this code. I am looking to redirect someone to a specific page when they swipe to unlock and automatically transfer them to another page when the swipe ends. Any help is greatly appreciated. Thank you! $ ...

Dealing with repeated parameters in a URLHow can you handle duplicate

My Ajax select input dynamically changes the URL without refreshing the page. However, I have encountered an issue where repeated parameters stack in the URL when the select input is changed multiple times: [domain]/find.php?cat=1#pricemin=10&pricem ...

Step-by-step guide to implementing a sticky header while scrolling

How can I implement a fixed header on scroll, like the one seen on this website: www.avauntmagazine.com Here is the HTML for my header: <div class="bloc bgc-wild-blue-yonder l-bloc " id="bloc-1"> <div class="container bloc-sm"> &l ...

The act of sending back Null from the Array.map() function

I've been attempting to retrieve data from a JavaScript object using the array.map() function. However, the result I'm receiving is null. I'm confused as to what the issue might be. Here's the object: export const Course = [ { co ...

Setting the default selected option in Vue for an object

Can the v-model data be different from the default option in this scenario? data: function() { return { user: { usertype: {}, } } <select v-model="user.usertype" class="btn btn-secondary d-flex header-input"> <option v-for= ...

The addClass function in jQuery does not seem to be functioning properly when used within

I've run into an issue with my jQuery addClass function in a loop. It's supposed to turn my Font Awesome star golden, but for some reason, it's not working as expected. The loop itself is functioning properly - I double-checked this by using ...

What is the best way to dynamically change the content of a div based on user selection?

When a user selects an option in the HTML, I want to display another div set to Block. I tried putting the OpenAskuser() function in a button, but it didn't work either. It would be ideal if we could achieve this without a button. Just have the displ ...

Angular: Defining variables using let and var

When working with TypeScript and JavaScript, we typically use either let or var to declare a variable. However, in Angular components, we do not use them even though Angular itself uses TypeScript. For instance, export class ProductComponent implements OnI ...

Set the value of a hidden field and proceed to submit it in CodeIgniter

I seem to be struggling with a simple task of setting a hidden input value. Here is how my form is structured: <?php echo validation_errors(); ?> <?php echo form_open('purchasing'); ?> <h1>Purchasing Re ...

Transferring binary fragments to Node.js for assembly into a complete file. Creating a file

Hey there, I'm in a bit of a bind. I'm trying to send file chunks using multiple XMLHttpRequest requests and then receive these parts in Node.js to reconstruct the original file from the binary data. The issue I'm facing is that the final f ...

JavaScript throws an error when attempting to access an object's methods and attributes

Within my Angular.js module, I have defined an object like this: $scope.Stack = function () { this.top = null; this.size = 0; }; However, when I try to use the push method of this object, I encounter an error stating undefined: ...

Synchronizing two navigation menus on a single-page application website

Let me start by saying that I specialize in back end development and am facing a specific challenge with building a website that includes two navigation menus. The main navigation menu features links like Home, while the sub-navigation menu includes option ...

Ways to adjust a specific div within an ng repeat using the value from JSON in AngularJS

When I select a different option from the dropdown menu, such as cities or states, the values are populated from a JSON file. My specific requirement is to hide a button only when the value 'No data' is populated upon changing the dropdown select ...

extraction of information from an object within an array

I am working with an array of objects containing certain keys and values. My goal is to organize these objects by key and then display all the values associated with each key together. [ { '18': 'x' }, { '17': 'y' ...

Add the hue value from Hue into the Chromajs HSL state value

My objective is to dynamically change the background color of a div based on user input. I plan to assign the user's input as the value of the state key hue, and then set another state key called color to hold the HSL representation of the hue using C ...

How should elements be properly inserted into injected HTML code?

We are currently phasing out our custom forms in React on the website, and transitioning to Microsoft Dynamics 365 generated forms. These new forms are injected through a React placeholder component created by a script that loads the js bundle and inserts ...

How to modify this to return a function and eliminate the need for declaring a function

Greetings! I understand that this may seem simple to some of you, but I am feeling quite lost. I've been tasked with removing the function declaration and converting it into a return function. Any assistance would be greatly appreciated. const canView ...

Error in fullCalendar where events are appearing on incorrect days in the month view of the current month

My fullcalendar plug-in is causing some trouble. I'm trying to show events in the monthview of the calendar, but when I'm in the current month, events on the same day of the week are not displaying correctly. They end up showing on the Sunday blo ...

Props does not solely rely on Vue.js for data feeding

My journey with learning vue has just started, and I recently incorporated a prop into my vue component. At first glance, the code appeared to be correct, but then something unexpected occurred. import Vue from 'vue'; import App from './A ...