0

This could be a trivial question. But has some doubts in the below scenario.

  1. I have a master logout, and this master logout has to call multiple individual logout pages.
  2. These individual logout pages has to be called in the background.
  3. Some of the individual logout pages can redirect to master logout (very rare, could be due to a programming mistake). But just want to consider it as failure scenario.

To achieve this, a. I added hidden img tags to MasterLogout.html b. And src attribute of each of this img tag is pointing to teh logout pages, say img tag's src is src="http://testapp1.abc.com/logout.html" say img tag's src is src="http://testapp2.abc.com/logout.aspx"

c.Based on my observation form HTTP header trace, logout URL's in src tag are being called, and I see some response codes 200, 302 etc., d. Also the logout functionalities is working well.

However I have the below doubts, need inputs on below.

Q1. How does img tag behave when its src is pointed to any html etc other than img. Does throw an error to browser? Can it cause any rendering issues to UI in any browseres etc ( IR, firefox, chrome didnt show any issues in my observations so far).

Q2. when the individual logout page gives a response of 302, is this reidrect reponse followed by the browser? ( I didnt see any redirections are HTTP trace, but want to know about the behaviour in diff browsers or any special cases that could cause an issue here

Thanks, Malli.

2 Answers2

1

Q1: Img tags can have an src pointing at whatever, the browser makes a request, and tries to render the response as an image, if it fails it will show the broken image icon and/or the alt text, but if the image is hidden it's not gonna render it anyway, neither it will throw any other error.

Q2: 302 responses are being handled on HTTP level, thus yes, the browser will follow the redirect, regardless if it's in an img src or elsewhere, but in your use case it will not cause any issue.

Szabolcs Páll
  • 1,402
  • 6
  • 25
  • 31
-1

use data-* attributes with javascript or jquery

get data attributes in JavaScript code

Community
  • 1
  • 1
hakki
  • 6,181
  • 6
  • 62
  • 106